I am doing full text search with ElasticSearch. I am using Query String Query. I am doing search with Multi Field feature.
My query looks like below:
{
"query": {
"query_string": {
"fields": [
"field1^5",
"field2^5",
"field3^1",
"field4^1",
...................
...................
],
"query": "....",
"default_operator": "OR",
"analyzer": "standard"
}
}
}
I have more than 30 fields in my collection. For my requirement, I need to ensure that fieldA, fieldB need to be searched first. Hence these fields will have higher priority. Other fields all have low and equal priority.
So, is there some way where I don't have to specify all the field names in the query. I only want to specify those fields that have higher priority i.e fieldA , fieldB. But, the searching should be performed on all fields based on priority order.
How could I achieve this ?
{ "query":{ "multi_match" : { "query": "searching string", "fields": [ "field1", "field2",... ,"fieldN"] } } }This might be helpful to you? am i right ?30 fieldsin my query. But only fields:"fieldA"and"fieldB"are of higher priority. So, I only want to keep"field1"and"field2"in the query. So, I am looking for a way if this is possible._allfield? Where you can have all low priority fields included in_allfield.