Facet labels and other schema settings

Created on 27 May 2025, about 1 month ago

Problem/Motivation

Currently, there is only a search field and the options displayed - there is no label indicating what we are actually filtering by, like in the examples below:
https://www.algolia.com/doc/guides/building-search-ui/widgets/showcase/js/
https://ecommerce-store.typesense.org/
https://linux-commits-search.typesense.org/

Proposed resolution

When the Facet option is enabled for a field, there should be an additional input for specifying the Label, which should also be translatable for multilingual support.
After that, similar to the TypesenseClient::getFields() function, we could read the labels from the schema (e.g., getFieldLabels) and pass them to the JS.

In a similar way, many other settings related to the fields could be added to the schema, so that JS can handle them dynamically during rendering - just like in the Facets module.
This way, all configurations would be managed within the site build.

Examples of such settings include:
- Show search box
- Show the amount of results
- Limits (soft, hard) - Limit the number of displayed facets (+ Show more label, Show less label, Show reset link)
- Hide facet with 1 result - When the facet has only one result, it will be hidden
- Range slider - Add range results for all the steps between min and max range
- URL alias - The alias appears in the URL to identify this facet (for routing)
- etc.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇷🇸Serbia norbert-goco Subotica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024