How to achieve same results as cutoff_frequency with minimum_should_match with Elasticsearch 8.X after deprecation of common term queries

If I make a search for a term in the database of say movie titles, I want it to do an AND query for all the words in the search query that have higher than certain cutoff_frequency and OR query for all the words in the search query that have lower than certain cutoff_frequency.

The idea is if I search for "The pirates of the caribbean sea" I want only very unique words to have an AND operator i.e. 'pirates' and 'caribbean' and 'the', 'of' and 'sea' should be searched with 'OR' operator.

In the previous version 6.4, doing this was exactly possible using common term queries as below -

GET /_search
{
    "query": {
        "common": {
            "body": {
                "query": "nelly the elephant as a cartoon",
                "cutoff_frequency": 0.001,
                "low_freq_operator": "and"
            }
        }
    }
}

How can I achieve the same in the latest version?

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