Skip to content

Conversation

dimitris-athanasiou
Copy link
Contributor

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

)

`FieldCapabilitiesFetcher` performs a can-match in order to quickly
return an empty response if no shard can match. However, if can-match
fails for some reason, it can cause the field capabilities request to fail.

An example of that is when a semantic query is used as filter. can-match
will fail as it won't be able to expand the inference results of the query.

In cases like that, it makes no sense to fail the field capabilities request.
Instead, we should treat can-match as returning `true` to proceed.

This change does that by following suit with other callers of can-match.

Fixes elastic#116106

(cherry picked from commit 7295189)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceFeatures.java
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java
#	x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/10_semantic_text_field_mapping.yml
#	x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/10_semantic_text_field_mapping_bwc.yml
@dimitris-athanasiou dimitris-athanasiou merged commit 2061511 into elastic:9.0 Sep 11, 2025
19 checks passed
@dimitris-athanasiou dimitris-athanasiou deleted the backport/9.0/pr-134134 branch September 11, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants