Facets and Filters Overview | Yext Hitchhikers Platform
What You’ll Learn
In this section, you will learn:
- What are facets and filters
- What are the best practices
Overview
Facets and filters are useful methods for refining your search results using various characteristics of your content. An Administrator can set facets and filters for Search in the Search Configuration file. Before we dive into how to implement them, we will provide an overview of each and some common use cases.
What are Static Filters?
Static Filters are viewable “pre-search” and are not dependent on the search query. Think of them as supplemental to what a user types in a free-form search bar. One example is Google’s “time” filters – the filters they display are not dependent on the results of a search, and every time a user enters a new query in the search bar, they are submitted as an additional filter, alongside the natural language query:
What are Facets?
Facets are viewable “post-search”, since they’re dependent on the search query, and can be used to further refine a query. Facets usually have a number next to each one, to indicate the result count. Google shopping is a good example; note that all the filters on the left hand side are facets. These facets (Department, Style) are contingent on (and update based on) the results set. In this way, they’re more helpful to an end-user, since they are relevant to their search.
Best Practices:
When thinking about whether to implement facets, think about the types of queries your users are searching and how you would want to refine these searches. In most cases, facets are encouraged.
For example, take the query: “I need a doctor”. Our search engine might want to offer up facets of “Conditions treated” or “Insurances accepted” or “speciality”. The Administrator should think about how you want to help the user narrow down their search.
As another example, consider the following facets for Jobs entity type: what attributes would a user want to consider when selecting which job to apply to?
Other use cases might include:
- Sizes for the Product entity type: XS, S, M, L, XL.
- Menu Sections for the Menu Item entity type: Pasta, Pizza, Salads, Side Options, Dessert.
- Employment Offerings for the Job entity type: Full Time, Part Time, Flexible Hours etc.
- Services for the Location entity type: Drive-thru, ATM, Safe Deposit Box.
By contrast, static filters should be for things that:
- Don’t make as much sense in a natural language query; you would never have an NLP filter and a static filter on the same field.
- Generally aren’t super long lists.
Note that all fields are not yet supported as NLP filters, namely booleans and hours. Keep this in mind as you build your frontend configuration, and feel free to raise your use cases in the Community.