Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between $filter and facet in Azure Search

Quite new to Azure Search, and just wondering what is the difference between facet and filter?

Say I have a product table, and it has category and subcategories. If I want to return things under one category, should I use $filter or use facet? What is the difference between these two?

Many Thanks

like image 528
daxu Avatar asked Nov 16 '16 16:11

daxu


People also ask

What is facet in Azure search?

Facet results are documents found in the search results that match a facet term. In the following example, in search results for cloud computing, 254 items also have internal specification as a content type. Items aren't necessarily mutually exclusive.

What is the difference between a filter and a facet?

Filters eliminate search results using initial criteria and never change between searches. Facets are used to refine search results using result attributes, and will change depending on the search query.

What is a facet in search?

Facets, also known as facet filters, allow users to refine their searches by multiple dimensions at the same time. Faceted search is a more granular way to find products and results in a specific, targeted way that is not possible with broad, one-size-fits-all filters.

What is facets in Algolia?

Facet filtering, filtering based on facet values, is a helpful feature for users since it allows them to find specific, targeted results in a way that isn't possible with one-size-fits-all filters. You can combine facet filters with AND (conjunctive) and OR (disjunctive) operators.


1 Answers

Filter is used to restrict which documents are returned by a query. Faceting is used to produce summaries of field values across those documents. Details are here and you can find more general info about how to use faceting and filter together here.

For your specific example, to retrieve documents for one category, use a filter. If you then want to see how many of those documents there are for each sub-category of that category (for example), use facets.

like image 120
Bruce Johnston Avatar answered Sep 22 '22 18:09

Bruce Johnston