Understanding Facets and Filters in Cludo
Facets and filters play a central role in helping users narrow down their search results. In Cludo, facets are generated from indexed fields within the crawler and can be displayed on your search results page (SERP) to allow users to refine results based on specific categories or metadata values.
What Are Facets?
Facets are structured fields that allow users to filter search results. One of the most common examples is the Category facet, which can include values like “Blog,” “News,” or “Events.” When a user clicks on a facet value, the search results are refined to include only items matching that value.
How Cludo Uses Indexed Fields to Power Facets
The crawler identifies data on your site and stores it in specific fields such as the Category field.
These fields can be edited or supplemented by custom fields. You can also choose to ignore or make a field required, add fallback sources (like XPath or meta tags), and even set default values.
The Category field is automatically used by the search UI to power the “Category” facet. If you want additional facet groups, you can:
- Add a custom crawler field
- Index relevant metadata into that field
- Request that Cludo configure it as a facet on the engine level (contact Cludo Support or you Customer Success Manager)
Once a crawler is connected to an engine, these fields can be used to enable dynamic filtering on the SERP.
Enabling Facets via Cludo Templates
If you are using Cludo’s Rich Inline Template, you can configure facets using the following properties:
facets: {
keys: ["Category", "YourCustomField"],
applyMultiLevel: true,
defaultValues: {
Category: ["Blog"]
}
},
facetOptions: {
multiSelect: {
Category: true
},
customOrder: {
Category: ["Blog", "News", "Events"]
},
customFacetKey: {
Category: "Filter your search"
}
},
categorizeResultsByField: {
field: "Category",
maxResultsPerCategory: 3,
maxCategories: 4
}
Enabling Facets in React
Cludo’s React component library supports facets using <FacetGroup /> and related components. Visit React Storybook to see code examples and prop configuration.
Filters in the Search API
If you’re using Cludo’s Search API directly, filters can be applied in the request body like this:
{
"filters": {
"Category": ["Blog", "Events"]
},
"notFilters": {
"EventDate_date": ["2025-01-01", "2025-12-31"]
},
"filters": {
"range": ["Price", 20, 100]
},
"postFilters": {
"Category": ["News"]
},
"enableFacetFiltering": true,
"postFiltersOperator": "or"
}
Filter Types:
- Value filters (e.g., specific categories)
- Range filters (e.g., Price: 20–100)
- Date filters (e.g., EventDate_date: 2023-01-01 to 2023-12-31)
Sorting Results by Date
If you want users to be able to sort search results chronologically, you’ll first need to ensure that a valid date field is being indexed by the crawler.
1. Configuring the Crawler for Dates
Follow the steps in this guide to:
- Enable date crawling
- Choose the appropriate source for the date (e.g., meta tag, structured data, etc.)
- Verify the correct field is being populated with a machine-readable date format (ISO 8601)
Cludo will index the date in a field like Date or a custom field you define.
2. Enabling Date Sorting in the SERP
Once your engine has a valid date field, Cludo can enable sorting options on your SERP:
- Newest First: Shows the most recent results first
- Oldest First: Optional configuration
For inline templates, you can configure sort options in the snippet. In custom or React implementations, you’ll can create a dropdown or sort component that uses the sortBy parameter in the search request:
{
"sortBy": [
{
"field": "Date_date",
"order": "desc"
}
]
}
If you need help setting up new facets or filters, contact Cludo Support at support@cludo.com.