azure-cognitive-searchdismax

AzureSearch : Dismax query parser capabilities


Is there any possibility of using Dismax Query Parser like capabilities in Azure search. e.g. Query Fields (qf), Phrase Fields (pf), boost function or boost query.

I am aware of the fact that currently Azure Search supports lucene query syntax. Want to check if there is some another term / parser available for equivalent functionalities or if not then is AzureSearch team is looking to incorporate it in coming time.

Here is the link for reference to DismaxQueryParser https://cwiki.apache.org/confluence/display/solr/The+DisMax+Query+Parser

Thanks


Solution

  • Azure Search doesn't support DisMax queries. Depending on what you need out of DisMax queries you may be able to obtain similar results in other ways.

    From the recall standpoint, DisMax queries are the same as Boolean queries in that for disjunctions both consider a document a match under the same conditions. The difference is that DisMax scores the resulting match by taking the highest individual match (plus an optional tie breaker) and Boolean queries add up the scores by default.

    If what you need from DisMax is the simple syntax with quotes, +/-, etc. then using queryType=simple (the default) will give you most of that in Azure Search, with the exception of "~" (fuzzy/slop).

    If what you need is the actual disjunction-maximum way of scoring matches, then that's not doable today.

    As for the other features you mention:

    For details on searchFields and other query options: https://learn.microsoft.com/en-us/rest/api/searchservice/search-documents

    For details on scoring profiles: https://learn.microsoft.com/en-us/rest/api/searchservice/add-scoring-profiles-to-a-search-index