I have set up the synonym_graph as [“error” => “system failure”]
And have been using the following query:
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "unexpected error occurred",
"fields": ["text"],
"type": "phrase",
"auto_generate_synonyms_phrase_query":true
}
}
]
}
}
}
This returns the results that have either “unexpected error occurred” or “unexpected system failure occurred”.
But I would also like to include results that have synonyms of these keywords such as “system failure” regardless of the other keywords present in the query.
I do not want to increase the result set by using the ‘operator: OR’ query here. Nor do I want to split all the keywords and send independent query for each.
How can this be achieved here?