-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Use Suppliers To Get Inference Results In Semantic Queries #136720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Suppliers To Get Inference Results In Semantic Queries #136720
Conversation
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
|
Hi @Mikep86, I've created a changelog YAML for you. |
...rnalClusterTest/java/org/elasticsearch/xpack/inference/integration/IntegrationTestUtils.java
Outdated
Show resolved
Hide resolved
...nce/src/main/java/org/elasticsearch/xpack/inference/queries/InferenceResultsMapSupplier.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/elasticsearch/xpack/inference/queries/InterceptedInferenceQueryBuilder.java
Show resolved
Hide resolved
...nce/src/main/java/org/elasticsearch/xpack/inference/queries/InferenceResultsMapSupplier.java
Outdated
Show resolved
Hide resolved
|
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't fully understand why all clusters need to know about all the inference ids. Why wouldn't the rewrites happen fully on the remote clusters, period?
That is a bigger question, shouldn't block this PR. But this logic is absurdly complicated, and suspect has more sneaky bugs that await us.
.../inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java
Outdated
Show resolved
Hide resolved
.../inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java
Outdated
Show resolved
Hide resolved
|
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM
.../inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java
Show resolved
Hide resolved
...rnalClusterTest/java/org/elasticsearch/xpack/inference/integration/IntegrationTestUtils.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is OK I haven't reviewed deeply, I will defer to searchorg folks here.
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
Updates the
semanticquery and the semantic query rewrite interceptors to use suppliers when building the inference results map.This fixes #136621, which was caused by changes made in #134956. In particular, gating inference action registration on
queryRewriteContext.hasAsyncActions() == falsecaused problems when a query contained many clauses with asemanticor intercepted query. ThehasAsyncActionscheck would only allow onesemantic/intercepted query to register inference action(s) per rewrite iteration. If the query contained more than 16 clauses withsemanticor intercepted queries, the rewrite rounds would be exhausted.This is fixed through the usage of suppliers, which removes the need for the
queryRewriteContext.hasAsyncActions() == falsecheck and allows allsemantic/intercepted queries to register inference actions(s) in the same rewrite round.This PR also refactors some of the util methods used in
inferenceplugin integration tests into a common location.