-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Handle semantic text partial updates when the field is in an object #117272
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
Handle semantic text partial updates when the field is in an object #117272
Conversation
…ield is in an object
|
Hi @Mikep86, I've created a changelog YAML for you. |
...rc/yamlRestTest/resources/rest-api-spec/test/inference/60_semantic_text_inference_update.yml
Outdated
Show resolved
Hide resolved
| - do: | ||
| update: | ||
| index: test-in-object-index | ||
| id: doc_1 | ||
| body: | ||
| doc: { "object.sparse_source_field": "sparse data 3", "object.dense_source_field": "dense data 3" } | ||
|
|
||
| - do: | ||
| get: | ||
| index: test-in-object-index | ||
| id: doc_1 | ||
|
|
||
| - match: { _source.object.sparse_field.text: "sparse data 1" } | ||
| - length: { _source.object.sparse_field.inference.chunks: 3 } | ||
| - match: { _source.object.sparse_field.inference.chunks.1.text: "sparse data 2" } | ||
| - exists: _source.object.sparse_field.inference.chunks.1.embeddings | ||
| - match: { _source.object.sparse_field.inference.chunks.2.text: "sparse data 3" } | ||
| - exists: _source.object.sparse_field.inference.chunks.2.embeddings | ||
| - match: { _source.object.dense_field.text: "dense data 1" } | ||
| - length: { _source.object.dense_field.inference.chunks: 3 } | ||
| - match: { _source.object.dense_field.inference.chunks.1.text: "dense data 2" } | ||
| - exists: _source.object.dense_field.inference.chunks.1.embeddings | ||
| - match: { _source.object.dense_field.inference.chunks.2.text: "dense data 3" } | ||
| - exists: _source.object.dense_field.inference.chunks.2.embeddings |
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.
Notice how the updated values for object.sparse_source_field and object.dense_source_field are appended instead of overwritten. This is because they are defined using a flat path instead of a nested path, resulting in a merged _source with both values:
{
"object": {
"sparse_source_field": "sparse data 2",
"dense_source_field": "dense data 2",
},
"object.sparse_source_field": "sparse data 3",
"object.dense_source_field": "dense data 3"
}|
Pinging @elastic/search-eng (Team:SearchOrg) |
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
|
Hi @Mikep86, I've updated the changelog YAML for you. |
Addresses #117258