Skip to content

Commit

Permalink
Update newQueryShardContext() overload to fix breaking changes (opens…
Browse files Browse the repository at this point in the history
…earch-project#15710)

Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
  • Loading branch information
harshavamsi authored and dk2k committed Oct 21, 2024
1 parent 8953ce8 commit c859705
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion server/src/main/java/org/opensearch/index/IndexService.java
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public IndexSettings getIndexSettings() {
* {@link IndexReader}-specific optimizations, such as rewriting containing range queries.
*/
public QueryShardContext newQueryShardContext(int shardId, IndexSearcher searcher, LongSupplier nowInMillis, String clusterAlias) {
return newQueryShardContext(shardId, searcher, nowInMillis, clusterAlias, false, false);
return newQueryShardContext(shardId, searcher, nowInMillis, clusterAlias, false);
}

/**
Expand Down Expand Up @@ -913,6 +913,22 @@ public QueryShardContext newQueryShardContext(
);
}

/**
* Creates a new QueryShardContext.
* <p>
* Passing a {@code null} {@link IndexSearcher} will return a valid context, however it won't be able to make
* {@link IndexReader}-specific optimizations, such as rewriting containing range queries.
*/
public QueryShardContext newQueryShardContext(
int shardId,
IndexSearcher searcher,
LongSupplier nowInMillis,
String clusterAlias,
boolean validate
) {
return newQueryShardContext(shardId, searcher, nowInMillis, clusterAlias, validate, false);
}

/**
* The {@link ThreadPool} to use for this index.
*/
Expand Down

0 comments on commit c859705

Please sign in to comment.