Skip to content

[8.18] Prevent field caps from failing due to can match failure (#134134)#134558

Merged
dimitris-athanasiou merged 5 commits intoelastic:8.18from
dimitris-athanasiou:backport/8.18/pr-134134
Sep 11, 2025
Merged

[8.18] Prevent field caps from failing due to can match failure (#134134)#134558
dimitris-athanasiou merged 5 commits intoelastic:8.18from
dimitris-athanasiou:backport/8.18/pr-134134

Conversation

@dimitris-athanasiou
Copy link
Contributor

Backport

This will backport the following commits from main to 8.18:

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 7fe3799 into elastic:8.18 Sep 11, 2025
16 checks passed
@dimitris-athanasiou dimitris-athanasiou deleted the backport/8.18/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

2 participants