Open
Description
Elasticsearch Version
8.15.x, 8.16.x, 8.17.x
Installed Plugins
No response
Java Version
bundled
OS Version
N/A
Problem Description
Under certain scenarios, you are unable to update a semantic text field using the Update API when the semantic text field is in an object field.
Steps to Reproduce
- Create an index with a semantic text field in an object:
PUT _inference/sparse_embedding/my-elser-endpoint
{
"service": "elser",
"service_settings": {
"num_allocations": 1,
"num_threads": 1
}
}
PUT my-index
{
"mappings": {
"properties": {
"object": {
"properties": {
"inference_field": {
"type": "semantic_text",
"inference_id": "my-elser-endpoint"
}
}
}
}
}
}
- Add a document to the index, defining the semantic text field value using a nested structure
PUT my-index/_doc/doc1
{
"object": {
"inference_field": "test value"
}
}
- Update the document using the Update API, defining the semantic text field value using a flat structure
POST my-index/_update/doc1
{
"doc": {
"object.inference_field": "updated value"
}
}
The update fails with the error:
{
"error": {
"root_cause": [
{
"type": "status_exception",
"reason": "Invalid format for field [object.inference_field], expected [String] got [ArrayList]"
}
],
"type": "status_exception",
"reason": "Invalid format for field [object.inference_field], expected [String] got [ArrayList]"
},
"status": 400
}
Logs (if relevant)
No response
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
elasticsearchmachine commentedon Nov 21, 2024
Pinging @elastic/search-eng (Team:SearchOrg)
elasticsearchmachine commentedon Nov 21, 2024
Pinging @elastic/search-relevance (Team:Search - Relevance)