Introduce Template query#16818
Conversation
|
❌ Gradle check result for ff1acc0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
a159416 to
cf97416
Compare
|
updated |
|
❌ Gradle check result for cf97416: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
@mingshl I sadly cannot do it (not a maintainers on |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16818 +/- ##
=========================================
Coverage 72.24% 72.25%
+ Complexity 65421 65403 -18
=========================================
Files 5306 5309 +3
Lines 304215 304300 +85
Branches 44118 44124 +6
=========================================
+ Hits 219788 219866 +78
+ Misses 66414 66377 -37
- Partials 18013 18057 +44 ☔ View full report in Codecov by Sentry. |
dbwiddis
left a comment
There was a problem hiding this comment.
Some concerns here:
- breaking API
- synchronization issues
- I'm not sure your substitution is doing what you think it's doing (or it's doing something not expected by a casual reader)
server/src/main/java/org/opensearch/index/query/QueryRewriteContext.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/query/BaseQueryRewriteContext.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/query/TemplateQueryBuilder.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/query/TemplateQueryBuilder.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/query/TemplateQueryBuilder.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/query/TemplateQueryBuilder.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/query/BaseQueryRewriteContext.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/query/BaseQueryRewriteContext.java
Show resolved
Hide resolved
Make QueryRewriteContext an interface. Rename existing impl to BaseQueryRewriteContext. Create coordinator-level context called QueryCoordinatorContext. It can expose pipelined search request, including PipelineProcessingContext to rewrite methods. Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Introduce template query that holds the content of query which can contain placeholders and can be filled by the variables from PipelineProcessingContext produced by search processors. This allows query rewrite by the search processors. Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com> Add changelog Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
e5784fd to
fcc44d5
Compare
|
❌ Gradle check result for fcc44d5: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❕ Gradle check result for fcc44d5: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
dbwiddis
left a comment
There was a problem hiding this comment.
LGTM thanks for your patience!
Introduce template query that holds the content of query which can contain placeholders and can be filled by the variables from PipelineProcessingContext produced by search processors. This allows query rewrite by the search processors. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com> Co-authored-by: Michael Froh <froh@amazon.com> (cherry picked from commit 13ab4ec) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Introduce template query that holds the content of query which can contain placeholders and can be filled by the variables from PipelineProcessingContext produced by search processors. This allows query rewrite by the search processors. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com> Co-authored-by: Michael Froh <froh@amazon.com> Signed-off-by: expani <anijainc@amazon.com>
Introduce template query that holds the content of query which can contain placeholders and can be filled by the variables from PipelineProcessingContext produced by search processors. This allows query rewrite by the search processors. Backport 2.x note: Instead of extracting an interface from QueryRewriteContext, we can keep it as a base class and subclass it for QueryCoordinatorContext. This avoids a breaking API change on the 2.x line. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Michael Froh <froh@amazon.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Introduce template query that holds the content of query which can contain placeholders and can be filled by the variables from PipelineProcessingContext produced by search processors. This allows query rewrite by the search processors. --------- Signed-off-by: Mingshi Liu <mingshl@amazon.com> Co-authored-by: Michael Froh <froh@amazon.com> Signed-off-by: Eugene Tolbakov <ev.tolbakov@gmail.com>
Description
This Pull Request introduces the following key enhancements:
1. New 'Template' Query Type:
Implements a new query type that holds an object of query content.
Supports placeholders within the query content.
Passes the query content to search request processing.
2. Query Rewrite Context Refactoring:
Query Rewrite Context now carries the pipelineContext variables after all search request processors processed.
Template queries resolve placeholders during query rewrites.
Inner queries are constructed dynamically based on resolved placeholders.
Related Issues
#16823
opensearch-project/ml-commons#3054
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.