@@ -86,7 +86,6 @@ public class QueryShardContext extends QueryRewriteContext {
86
86
private final BiFunction <MappedFieldType , String , IndexFieldData <?>> indexFieldDataService ;
87
87
private final int shardId ;
88
88
private final IndexReader reader ;
89
- private final String clusterAlias ;
90
89
private String [] types = Strings .EMPTY_ARRAY ;
91
90
private boolean cacheable = true ;
92
91
private final SetOnce <Boolean > frozen = new SetOnce <>();
@@ -110,6 +109,23 @@ public QueryShardContext(int shardId, IndexSettings indexSettings, BitsetFilterC
110
109
SimilarityService similarityService , ScriptService scriptService , NamedXContentRegistry xContentRegistry ,
111
110
NamedWriteableRegistry namedWriteableRegistry , Client client , IndexReader reader , LongSupplier nowInMillis ,
112
111
String clusterAlias ) {
112
+ this (shardId , indexSettings , bitsetFilterCache , indexFieldDataLookup , mapperService , similarityService , scriptService ,
113
+ xContentRegistry , namedWriteableRegistry , client , reader , nowInMillis , new Index (RemoteClusterAware .buildRemoteIndexName (
114
+ clusterAlias , indexSettings .getIndex ().getName ()), indexSettings .getIndex ().getUUID ()));
115
+ }
116
+
117
+ public QueryShardContext (QueryShardContext source ) {
118
+ this (source .shardId , source .indexSettings , source .bitsetFilterCache , source .indexFieldDataService , source .mapperService ,
119
+ source .similarityService , source .scriptService , source .getXContentRegistry (), source .getWriteableRegistry (),
120
+ source .client , source .reader , source .nowInMillis , source .fullyQualifiedIndex );
121
+ this .types = source .getTypes ();
122
+ }
123
+
124
+ private QueryShardContext (int shardId , IndexSettings indexSettings , BitsetFilterCache bitsetFilterCache ,
125
+ BiFunction <MappedFieldType , String , IndexFieldData <?>> indexFieldDataLookup , MapperService mapperService ,
126
+ SimilarityService similarityService , ScriptService scriptService , NamedXContentRegistry xContentRegistry ,
127
+ NamedWriteableRegistry namedWriteableRegistry , Client client , IndexReader reader , LongSupplier nowInMillis ,
128
+ Index fullyQualifiedIndex ) {
113
129
super (xContentRegistry , namedWriteableRegistry ,client , nowInMillis );
114
130
this .shardId = shardId ;
115
131
this .similarityService = similarityService ;
@@ -121,16 +137,7 @@ public QueryShardContext(int shardId, IndexSettings indexSettings, BitsetFilterC
121
137
this .scriptService = scriptService ;
122
138
this .indexSettings = indexSettings ;
123
139
this .reader = reader ;
124
- this .clusterAlias = clusterAlias ;
125
- this .fullyQualifiedIndex = new Index (RemoteClusterAware .buildRemoteIndexName (clusterAlias , indexSettings .getIndex ().getName ()),
126
- indexSettings .getIndex ().getUUID ());
127
- }
128
-
129
- public QueryShardContext (QueryShardContext source ) {
130
- this (source .shardId , source .indexSettings , source .bitsetFilterCache , source .indexFieldDataService , source .mapperService ,
131
- source .similarityService , source .scriptService , source .getXContentRegistry (), source .getWriteableRegistry (),
132
- source .client , source .reader , source .nowInMillis , source .clusterAlias );
133
- this .types = source .getTypes ();
140
+ this .fullyQualifiedIndex = fullyQualifiedIndex ;
134
141
}
135
142
136
143
private void reset () {
0 commit comments