Use Suppliers To Get Inference Results In Semantic Queries#136720
Use Suppliers To Get Inference Results In Semantic Queries#136720Mikep86 merged 22 commits intoelastic:mainfrom
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 |
benwtrent
left a comment
There was a problem hiding this comment.
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 |
.../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
benwtrent
left a comment
There was a problem hiding this comment.
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.