Skip to content

Commit 95642db

Browse files
authored
Update newQueryShardContext() overload to fix breaking changes (#15710)
Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
1 parent c505709 commit 95642db

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

server/src/main/java/org/opensearch/index/IndexService.java

+17-1
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ public IndexSettings getIndexSettings() {
867867
* {@link IndexReader}-specific optimizations, such as rewriting containing range queries.
868868
*/
869869
public QueryShardContext newQueryShardContext(int shardId, IndexSearcher searcher, LongSupplier nowInMillis, String clusterAlias) {
870-
return newQueryShardContext(shardId, searcher, nowInMillis, clusterAlias, false, false);
870+
return newQueryShardContext(shardId, searcher, nowInMillis, clusterAlias, false);
871871
}
872872

873873
/**
@@ -913,6 +913,22 @@ public QueryShardContext newQueryShardContext(
913913
);
914914
}
915915

916+
/**
917+
* Creates a new QueryShardContext.
918+
* <p>
919+
* Passing a {@code null} {@link IndexSearcher} will return a valid context, however it won't be able to make
920+
* {@link IndexReader}-specific optimizations, such as rewriting containing range queries.
921+
*/
922+
public QueryShardContext newQueryShardContext(
923+
int shardId,
924+
IndexSearcher searcher,
925+
LongSupplier nowInMillis,
926+
String clusterAlias,
927+
boolean validate
928+
) {
929+
return newQueryShardContext(shardId, searcher, nowInMillis, clusterAlias, validate, false);
930+
}
931+
916932
/**
917933
* The {@link ThreadPool} to use for this index.
918934
*/

0 commit comments

Comments
 (0)