Fix - Requesting _inference_fields when using legacy format causes shard failure#121720
Conversation
|
Hi @Samiul-TheSoccerFan, I've created a changelog YAML for you. |
|
Pinging @elastic/search-eng (Team:SearchOrg) |
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
kderusso
left a comment
There was a problem hiding this comment.
Great start @Samiul-TheSoccerFan !
@Mikep86 has already given all of the feedback I would have, once you address those comments I think this will be in a good place.
|
Sorry, I misread the change, it is related to the inference fields. The inference fields must be detected as a non-metadata field since the legacy format is used, meaning that we should never reach the |
|
Ok I think I understand now. We should do something like: The _inference_fields is a metadata field only on indices where |
Mikep86
left a comment
There was a problem hiding this comment.
Looks much better 🙌 ! I left one comment that we should address as I think not_exists will return true if any component of the queried path does not exist, meaning that the test could pass if no hits are returned.
...e/src/yamlRestTest/resources/rest-api-spec/test/inference/30_semantic_text_inference_bwc.yml
Show resolved
Hide resolved
kderusso
left a comment
There was a problem hiding this comment.
Nice work, thanks for making all of the iterations!
|
@Samiul-TheSoccerFan Looks like these changes broke |
Mikep86
left a comment
There was a problem hiding this comment.
Let's fix the broken test before merging
Mikep86
left a comment
There was a problem hiding this comment.
Good approach to fix the failing test. I added some comments about how we can clean it up.
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
Mikep86
left a comment
There was a problem hiding this comment.
LGTM, thanks for the iterations!
|
@jimczi Can you please take a look at this PR again and let us know if you have any concerns or suggestions. |
…ard failure (elastic#121720) * Adding condition to verify if the field belongs to an index * Update docs/changelog/121720.yaml * Remove unnecessary comma from yaml file * remove duplicate inference endpoint creation * updating isMetadata to return true if mapper has the correct type * remove unnecessary index creation in yaml tests * Adding check if the document has returned in the yaml test * Updating test to skip time series check if index mode is standard * Refactor tests to consider verifying every metafields with all index modes * refactoring test to verify for all cases * Adding assetFalse if not time_series and fields are from time_series * updating test texts to have better description
…ard failure (#121720) (#122177) * Adding condition to verify if the field belongs to an index * Update docs/changelog/121720.yaml * Remove unnecessary comma from yaml file * remove duplicate inference endpoint creation * updating isMetadata to return true if mapper has the correct type * remove unnecessary index creation in yaml tests * Adding check if the document has returned in the yaml test * Updating test to skip time series check if index mode is standard * Refactor tests to consider verifying every metafields with all index modes * refactoring test to verify for all cases * Adding assetFalse if not time_series and fields are from time_series * updating test texts to have better description
…ard failure (#121720) (#122178) * Adding condition to verify if the field belongs to an index * Update docs/changelog/121720.yaml * Remove unnecessary comma from yaml file * remove duplicate inference endpoint creation * updating isMetadata to return true if mapper has the correct type * remove unnecessary index creation in yaml tests * Adding check if the document has returned in the yaml test * Updating test to skip time series check if index mode is standard * Refactor tests to consider verifying every metafields with all index modes * refactoring test to verify for all cases * Adding assetFalse if not time_series and fields are from time_series * updating test texts to have better description
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
This PR fixes the shard failure error we get when we request the
_inference_fieldswith legacy semantic_text.Steps to reproduce:
And then when we
searchwith_inference_fields: