-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Closed
Copy link
Labels
:mlMachine learningMachine learning>enhancementTeam:MLMeta label for the ML teamMeta label for the ML team
Description
Description
When text_expansion receives a field that does not have the rank_features type, it simply returns an empty list of results:
GET search-books/_search
{
"query":{
"text_expansion":{
"wrong_inexistent_field":{
"model_id":".elser_model_1",
"model_text":"What wild animals live in Colorado?"
}
}
}
}
response:
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"max_score": null,
"hits": []
}
}
The text_expansion docs clearly state that the queried field must be of rank_features type, but this is not enforced at the API level.
Other Elasticsearch queries return an error message when the queried field is missing or it does not have a compatible type.
With rank_features fields and the ELSER pipeline that users can create in Kibana in the Enterprise Search plugin, it is very easy to miss exactly what field needs to be queried, because the rank_features fields are deeply nested under ml.inference. For example, this is a working query:
GET search-books/_search
{
"query":{
"text_expansion":{
"ml.inference.description_expanded.predicted_value":{
"model_id":".elser_model_1",
"model_text":"What wild animals live in Colorado?"
}
}
}
}
davidkyle
Metadata
Metadata
Assignees
Labels
:mlMachine learningMachine learning>enhancementTeam:MLMeta label for the ML teamMeta label for the ML team