Configuring the Faceted Search

In this article, we will look at a few global settings for the Faceted Search first. Then we will look at what kinds of Facets exist and how they can be configured individually.

Last, we will tackle when a facet appears in a certain Search Area (and when not!). In our experience, the problem of Search Facets not showing up (even when they are expected to do so) is quite common, so make sure you don’t skip that part!

 

Global Settings

Collapse Sidebar

This setting defines whether the sidebar with the Search Facets is visible or collapsed by default.

Note: You can toggle the sidebar with the Facets with a button in the search bar:

Facets only if maximum number [n] of search results

This setting's motivation is that from a certain number of search results on performance starts to be an issue. If this is the case, you can set a limit for the number of search results. When this number is exceeded, Search Facets will not be generated:

Facets from first [n] search results

The motivation here is similar to the previous one, only that this setting does limit the number of search results from which the Facets are built. This setting mostly makes sense if you can expect that all possible values of the Search Facets' attributes already occur within a limited number of results.

Maximum Number of Facet Options

Each Search Facet shows a maximum of 5 options. If there are more options to choose from, a 'Show more' button appears:

What you can define here is the default value of how many options (including the 5 initial options) can appear at the maximum when the ‘Show more’ button is clicked.

This value can be overwritten for each Search Facet individually.

Cache Facets for [n] Seconds

Both the available Facets and the individual options within each Facet get cached. When you are initially configuring the Search Facets, you might want to set this value to 0 or a few seconds to immediately see what you are configuring.

For a production setup, though, it is recommended not to set this value too low because users will frequently come back to previous search results, and having the facets cached will come in handy in this case.

Remove Facet Options when they become unavailable

When a user selects a Facet option, this will usually decrease the number of search results. This may also imply that options in other Search Facets become unavailable. By default, those values will be greyed out to indicate that another Facet's selection took them away.

If you check this option, the unavailable values will not be greyed out but will be removed instead.

Show only Facets available in all Search Results

  • If this option is checked, facets are built like this:

The common classes (=intersection) are collected from all search results, and only attributes of those common classes are considered when building Facets.

  • If this option is not set, the Facets are generated from the union of all search results' classes. This affects that if an item in the search has no class in common with the other search results, no facets will be displayed.

  • In any case, there must be at least two different values for each Facet. Otherwise, the Facet will not be displayed.

  • In most cases, it is advantageous to have this option checked.

Use Elastic Search for Facets

If the Elastic search is used, it can be used to build the Facets. In case an attribute type is not supported by the Elastic Search, the search will fall back to the relational database.

Defining individual Search Facets

Search Facets can be defined for products, files, and users. Because the configuration process is the same for all three, we will explain how Search Facets for products can be configured. With this knowledge, you should be able to configure all other Facets analogously.

About Search Facets in general

To get an intuitive understanding of how Search Facets are expected to work, you can look at websites like https://www.google.com/shopping.

Radio Buttons

The common understanding of options displayed as radio buttons is that you can choose one of the available options. If you click on another one, your selection will change to that option.

Checkboxes

With checkboxes, you can add as many options as you want.

Using multiple facets

Combining the selection of options from different Search Facets leads to more specific results.

The logic that users expect from Search Facets is that options from one Facet are combined with OR while different Facets are combined with AND.

For instance, in the examples above we could, select

‘Size L' AND ( 'Seat Tube Length’ 16.748 inches OR 17.1825 inches)

Deep Search allows us to implement a different logical behavior, but this might go against our users' expectations of how Search Facets work.

Example: Defining the 'Size' Facette

The ‘Size’ Facet is defined as a ‘Products’ Facet of type ‘Default'. The 'Label’ will appear in the sidebar above the Facet, so we gave it a short and concise name.

The ‘Sort Order’ defines in which order the Facets appear. Putting more general attributes on top and particular fields last generally makes sense.

As mentioned above, the 'Facet Logic' should be AND, in most cases, since using more Facets usually should restrict the search and not widen it.

'Field' selects the attribute we want to use for the Facet.

'Layout' gives us a lot of options. The most straightforward ones are Checkbox, Radio Buttons, Number Range, and Date Range.

The Number Range and Date Range are applicable when you want to narrow down the search results from many different numbers or date values.

‘Max Values’ sets the maximum number of options for the Facet. The last option offers to change the 'Case' of the displayed values.

“Description” Field for Facets

A new field (“Description“) was added to the Facet Definition. If set, it appears as Tooltip above the Facet.

Update: NEW “Theme Filter” for Facets

You can (optionally) select the Themes for which a facet is available. If no Themes are selected in the filter the facet is available for all facets.

Translation of Facets via Custom Dictionary

Both Facet Label and Facet Description can be translated with the Custom Dictionary. The dictionaries can be found in [Project]/templates/Dictionary.[lang].csv. This means you can have a language-specific Label and Description for each Facet.

All Facet Types and Layouts

Facet Type

Layout

Explanation

Attribute type

Facet Type

Layout

Explanation

Attribute type

Default

Auto

The attribute type will determine the Layout.

Most types, special display for Color

Default

Checkboxes

Multiple options can be picked and are connected with OR logic.

Most types

Default

Radio Buttons

Only one option can be selected at once.

Most types

Default

Search Field

Displayed as Text input Field.

You can use that field to filter for multiple values, e.g., a comma-separated list of IDs.

To configure this search scenario, the search logic can be set to “At least one of the keywords must occur” (= OR Search). Additionally, you can select multiple fields to be searched for, for example, the ExternalKey and PdmarticleID.

When you now copy and paste a column with IDs from an Excel Document, they will be filled in as space-separated text.

Most types

Default

Number Range

Displayed as a number slider.

Number, Number with unit, “number-like“ attributes

Default

Date Range

Displayed as a number slider with dates instead of numbers.

Date

Default

Hidden

Deprecated

 

Default

Keywords

This type can be used if an attribute contains a list of keywords separated by a specific separator.

List with separator

Value Range

-

Displayed as (hierarchical) checkboxes. In the case of hierarchical value lists, you can also configure at which hierarchy levels the facet should start and end.

Selection (from value list)

Reference

-

Displayed as checkboxes.

References

Sort

-

Deprecated

 

Number Range

-

Deprecated - The Default Facet Type with Number Range Layout replaces its functionality

 

Classification

-

Deprecated

 

When Facets are built (And when they are not…)

Let's have a look at the prerequisites for a Facet getting displayed for a certain search result:

  1. If the Show only Facets available in all Search Results is set, the Search Area items must have at least one class in common. Then attributes of the class(es) in common are considered. Also, items must have a value set for the attribute. Because this setting is so restrictive, it is better not to use this option in most cases.

  2. If all products have the same value for one attribute, there will be no Facet for that attribute.

  3. Facets and their options get cached. Make sure to either wait long enough, reduce the caching time, or delete the cache if values don’t show up. The first section of this article explains how to do that.

  4. Consider the effects of the ‘Facets only if maximum number [n] of search results’ and ‘Facets from first [n] search results’ options explained earlier in this article.

A little trick

You can press alt + left click (option + left click on Mac) on a Facet to directly access the Facet’s configuration from within the Search Portal.