Skip to content
Operator handbook
Filtersets
Hygraph
Hygraph

Filtersets

This article explains the Filterset model in Hygraph. Filtersets are the named groups in the filters sidebar on category pages, search results, and other product listings.

Filtersets

Each group heading comes from a Filterset. The options inside the group come from Tags that are assigned to that Filterset and to products.

An example: a Filterset titled Diet with tags such as Vegan and Gluten-free. Shoppers then filter the listing by those tags.

How to configure

To view, edit or create a Filterset, in Hygraph navigate via the left menu pane to Content, and in the secondary left menu pane under DEFAULT VIEWS select Filterset.

A list of all existing Filtersets, from all tenants, in the selected Environment, will be displayed. It is prudent to first filter by the relevant tenant, so you do not mistakenly edit a Filterset from another tenant. Selecting a Filterset from the list opens the edit page. To create a new Filterset, use the button on the top right of the screen.

Filtersets in Hygraph

How listing filters work

Three things must be in place for a filter option to appear on the shop:

  1. A Filterset exists for the tenant, with an Identifier and a localized Title.
  2. A Tag is assigned to that Filterset, and the same Tag is assigned to products as a filter tag (Filterset Products on the Tag, or Tags on the Product).
  3. The Filterset is allowed on that page: either selected on the Category, or (when the category has none) included in Default Filtersets on Settings. Search and other listings show Filtersets that have matching products.

If a Tag is only used as a badge or label, and is not assigned to a Filterset, it will not appear as a listing filter.

Tenant

As Hygraph is multi-tenant, the first and most important selection is the tenant. Only one tenant can be selected. Changing the tenant does not simply switch which shop you are viewing; it moves the Filterset to that tenant.

Identifier

Identifier (identifier) — required. The shop uses this value to match products to the filter group. Use a short stable value (for example diet). Do not change it after products are already using the Filterset; a new identifier will not pick up products that were indexed under the previous one.

Title

Title (title) — localized. This is the heading shown above the filter options on the website (for example “Diet”). Fill the locales you use. If a locale has no title, that Filterset is not shown for that locale.

Categories

Filtersets can be linked to Categories. On a category page, the filters sidebar shows only the Filtersets assigned to that category. Assign them from the Category (Filtersets on the category) or from the relations on the Filterset itself.

If a category has no Filtersets assigned, the Default Filtersets on Settings are used instead.

Tags

Assign tags on the Tag model, using the Filtersets field, and assign the same tags to the products that should be found when that option is selected (Filterset Products on the Tag, or Tags on the Product).

The Tag’s Tag text is what the shopper sees as the option (for example “Vegan”). The Filterset Title is the group heading.

Where Filtersets appear

  • Category pages — Filtersets selected on that category, or the Settings defaults when none are selected.
  • Search results — Filtersets that have matching tagged products.
  • Product listings — Filtersets that have matching tagged products, unless that listing hides the facet. See Product Listings.

Other shop filters (price, rating, and similar) are not configured as Filtersets.

Publishing

Filterset, Tag, and product-tag changes feed listing filters through Algolia. After publishing, request a build so new Filtersets and updated options show on listings and search. See Page revalidation.