-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add support for combined_fields (BM25F) #3996
Copy link
Copy link
Closed
Labels
SearchSearch query, autocomplete ...etcSearch query, autocomplete ...etcenhancementEnhancement or improvement to existing feature or requestEnhancement or improvement to existing feature or requestfeatureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededlucene
Description
Use Case
Currently when i want to search number field with provided free search text using multi_match, I get number_format_exception. what we checked in latest version of Elastic Search(7.17) it is possible to search using combined_fields. As AWS does not support combined_fields, we can not use combined_fields and as multi_match has problem with number field, we would not be able to upgrade our AWS OpenSearch, Lets take example.
in my_index document, year field is number, When I wanted to search like below:
GET my_index/_search
{
"query": {
"multi_match": {
"query": "2011 Toyota Corolla",
"type": "cross_fields",
"fields": [
"year",
"make",
"model"
]
}
}
}I got 400 Error:
{
"error": {
"root_cause": [
{
"type": "query_shard_exception",
"reason": "failed to create query: For input string: \"2012 Toyota Corolla\"",
"index_uuid": "dkHYbCuLSBKzHcwN3yQx6g",
"index": "instant_offer"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "instant_offer",
"node": "-X63-ynlS92dLxcUHMoyjA",
"reason": {
"type": "query_shard_exception",
"reason": "failed to create query: For input string: \"2012 Toyota Corolla\"",
"index_uuid": "dkHYbCuLSBKzHcwN3yQx6g",
"index": "instant_offer",
"caused_by": {
"type": "number_format_exception",
"reason": "For input string: \"2012 Toyota Corolla\""
}
}
}
]
},
"status": 400
}
When I remove year field from array of "fields", I got 200 Status code.
Feature Request
I would like to see combined_fields support in latest OpenSearch. So that we can resolve our problem.
GET my_index/_search
{
"query": {
"combined_fields": {
"query": "2011 Toyota Corolla",
"fields": [
"year",
"make",
"model"
]
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SearchSearch query, autocomplete ...etcSearch query, autocomplete ...etcenhancementEnhancement or improvement to existing feature or requestEnhancement or improvement to existing feature or requestfeatureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededlucene
Type
Projects
Status
✅ Done