Search code examples
azureazure-cognitive-search

Azure Search, filter by score


I would like to omit results with lower relevance.

Can do the filtering by myself, but I don't find any documentation on the scoring range.

for example, searching: "Sun protection", I would like to recive all results with "Sun protection" but not results with "sun light" or "snake protection"

I see a score from 0.8 would be good in that case, but is this persistent ? One criteria is to filter every result that have only one from the search term.

(Top parameter will not help beacuase it mate be 50 relevance results or 5)


Solution

  • please take a look at these questions:

    azure search sort and filter by score

    How do you include Azure Search's @search.score as part of your custom $orderby clause

    In general, document score reflects relative relevance of documents in a results set. It's not normalized so you can't compare it between different queries and there is no good threshold value you could use.

    In your example you could issue a phrase query: "sun protection" to make the entire phrase match or search for: sun+protection (sun AND protection) to make sure both terms match. We offer two different query formats, to learn more go to Simple query language and Lucene query language.

    Let me know if that helps,

    Janusz