Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Enable testing for ExtensiblePlugins using classpath plugins ([#16908](https://github.com/opensearch-project/OpenSearch/pull/16908))
- Introduce system generated ingest pipeline ([#17817](https://github.com/opensearch-project/OpenSearch/pull/17817)))
- Support create mode in pull-based ingestion and add retries for transient failures ([#18250](https://github.com/opensearch-project/OpenSearch/pull/18250)))
- Use QueryCoordinatorContext for the rewrite in validate API. ([#18272](https://github.com/opensearch-project/OpenSearch/pull/18272))

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected void doExecute(Task task, ValidateQueryRequest request, ActionListener
if (request.query() == null) {
rewriteListener.onResponse(request.query());
} else {
Rewriteable.rewriteAndFetch(request.query(), searchService.getValidationRewriteContext(timeProvider), rewriteListener);
Rewriteable.rewriteAndFetch(request.query(), searchService.getValidationRewriteContext(timeProvider, request), rewriteListener);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1783,17 +1783,17 @@ private void rewriteAndFetchShardRequest(IndexShard shard, ShardSearchRequest re
}

/**
* Returns a new {@link QueryRewriteContext} with the given {@code now} provider
* Returns a new {@link QueryCoordinatorContext} with the given {@code now} provider and {@link IndicesRequest searchRequest}
*/
public QueryRewriteContext getRewriteContext(LongSupplier nowInMillis, IndicesRequest searchRequest) {
return new QueryCoordinatorContext(indicesService.getRewriteContext(nowInMillis), searchRequest);
}

/**
* Returns a new {@link QueryRewriteContext} for query validation with the given {@code now} provider
* Returns a new {@link QueryCoordinatorContext} with the given {@code now} provider and {@link IndicesRequest searchRequest}
*/
public QueryRewriteContext getValidationRewriteContext(LongSupplier nowInMillis) {
return indicesService.getValidationRewriteContext(nowInMillis);
public QueryRewriteContext getValidationRewriteContext(LongSupplier nowInMillis, IndicesRequest searchRequest) {
return new QueryCoordinatorContext(indicesService.getValidationRewriteContext(nowInMillis), searchRequest);
}

public IndicesService getIndicesService() {
Expand Down
Loading