Multi token exact matching

I am trying to search on a field that has entries with multiple tokens like this:
doc1 { biz_name: biz }
doc2 { biz_name: biz inc }
doc3 { biz_name: big biz inc }

I want to search on field "biz_name" with "biz inc" and get back only doc2

Any help is appreciated! Thanks!

I am currently trying this with no success (currently brings back doc2 and doc3:
GET /my_index/_search
{
"size": 2000,
"timeout": "10m",
"query": {
"query_string": {
"query": "(biz_name: biz AND biz_name: inc)",
"fields": ,
"type": "best_fields",
"default_operator": "or",
"max_determinized_states": 10000,
"enable_position_increments": true,
"fuzziness": "AUTO",
"fuzzy_prefix_length": 0,
"fuzzy_max_expansions": 50,
"phrase_slop": 0,
"escape": false,
"auto_generate_synonyms_phrase_query": true,
"fuzzy_transpositions": true,
"boost": 1
}
},
"_source": {
"includes": ,
"excludes":
},
"track_total_hits": 2147483647
}

you may want to check out the match phrase query.

Also, the query string query supports phrases, see https://www.elastic.co/guide/en/elasticsearch/reference/7.6/query-dsl-query-string-query.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.