MultiMatchQuery useDisMax


We are in the process of upgrading to elastic cloud 7.x from 1.6. We have code that creates a MultiMatchQuery as follows:

QueryBuilders.multiMatchQuery(searchQuery, ElasticQueryCreator.SEARCH_FIELDS)

As of 6.x the useDisMax api has been deprecated and removed entirely in 7.x. What would be the best way to do this now? I found some documentation indicating that we should leverage tieBreaker() instead and set the tieBreaker to 1.0f. Another indicates using the new DisMaxQueryBuilder instead and adding the MultiMatchQuery to it such as:

        .add(QueryBuilders.multiMatchQuery(searchQuery, ElasticQueryCreator.SEARCH_FIELDS)

What would be the best way to achieve this?

Additionally, cutoffFrequency seems to be deprecated with no replacement. Documentation in 7.7 states:

"This option can be omitted as the Match can skip blocks of documents efficiently, without any configuration, provided that the total number of hits is not tracked."

I was going to just remove the call - until I read the last part indicating "provided that the total number of hits is not tracked". What exactly does this mean?


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