I am using the text_en_search analyzer with the following configuration to fetch results in OpenSearch:
"text_en_search": {
"filter": ["lowercase", "synonym_en", "stopword_en", "porter_stem"],
"type": "custom",
"tokenizer": "standard"
}
However, when I write a filter query with multiple match queries, I get results that match only one of the match queries. Here is the relevant part of my query:
{
"bool": {
"filter": [
{
"match": {
"title_extended": {
"query": "a",
"operator": "OR",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
},
{
"match": {
"title_extended": {
"query": "maruti",
"operator": "OR",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
}
Despite expecting the filter array to operate with an implicit AND operation, some of the results only match “a”.
Could you please provide a solution to resolve this issue?
Note: This is not the complete query but the main snippet that performs the logic.
I am expecting results that match both of the match queries, as all match queries should work with an implicit AND operation inside the filter array.
Karan Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.