Set Up Algolia Faceted Search
Algolia supports faceted search, which is an advanced search that allows users to filter search results. The following images shows "flat" faceted search, where there are headings with checkboxes for each filter. Paligo also supports "hierarchical" faceted search, where the filters are shown in a hierarchy, without checkboxes.
Faceted search is only available for one output language.
To set up Algolia faceted search, you must first set up the regular Algolia search (see Set Paligo to use Algolia Search). When you have Algolia search set up and working, there are three extra stages for flat faceted search: setting up your taxonomy, setting up your HTML5 layout for faceted search, and finally, setting up the Algolia index.
Set Up Taxonomies for the Facets
To use Algolia's faceted search with Paligo, you need to set up taxonomies to act as your "facets". Facets are filter categories.
-
In Paligo, create the taxonomy tags that you want to use as filter categories. You need to create a "parent" top-level taxonomy for each category type, and then individual taxonomy tags inside the categories. For example, to filter by model, you would create a "parent" taxonomy tag called "model". You would then create a "child" taxonomy tag for each model, such as "acme 100", "acme 200", "acme 300" and so on.
For additional filter categories, you add more "parent" and "child" taxonomy tags. For example, to add a "feature" category with filter options of "camera" and "flight", you would create a parent "feature" tag. You would then create a "camera" tag and a "flight" tag as "children" of the "feature" tag.
To learn more about creating taxonomies, see Create Taxonomy Tags.
Important
Only use lower case letters and numbers in your taxonomy tag names. Upper case letters are not supported.
Also we recommend that you do not use special characters such as comma and period as these may prevent the search from working.
-
Apply the taxonomy tags to your topics.
The HTML5 Help Center layout has settings for enabling faceted search and defining which taxonomies should be used as filter categories. You need to set these up before you publish.
-
Select Layout in the top menu.
-
Select the Layout you want to update or Create a Layout.
Tip
You can copy the URL of the Layout Editor and paste it into a new tab in your browser. This can be useful if you frequently switch between your Paligo content and the Layout settings.
-
Select Classes and attributes in the sidebar.
-
Set Output taxonomies to Enable.
This tells Paligo to include the taxonomies in the published output.
-
Select Search Engine in the sidebar.
-
Set Use Algolia Search to Enable.
-
Set Create separate search page for Algolia to Enable.
This tells Paligo to create a search page specifically for Algolia search. When you publish, it is available from an "advanced search" option that appears below the search field on the help center "portal page".
-
Set Output taxonomies as facets for Algolia Search page to Enable.
This tells Paligo to include taxonomies as "facets" (filter categories) on the Algolia search page.
-
Tell Paligo which "parent" taxonomies to use as a filter category. For this, use the field for the type of Algolia faceted search you want to create:
-
Taxonomies to use for flat Algolia facets
Use this field if you want flat Algolia faceted search.
-
Taxonomies to use for hierarchical Algolia facets
Use this field if you want hierarchical Algolia faceted search.
Enter the name(s) of each "parent" taxonomy that you want to be a filter category. You do not need to enter the "child" taxonomies. The names must be in lower case and use a semi-colon to separate the taxonomies, for example:
model;feature
Note
Only use one of the fields. You should only set Paligo to use flat faceted search or hierarchical faceted search, not both at the same time.
-
-
Select Save.
Configure Facets in the Algolia Index
To get the faceted search to work, you need to publish from Paligo so that Algolia gets an index for your publication. Paligo will create an index for each publication (1 index per language).
When your publication has an index in Algolia, you will need to configure the index to use facets. The facets are based on the taxonomy tags in Paligo (see Set Up Taxonomies for the Facets).
-
Publish your publication using the HTML5 Help Center layout you set up to use Algolia. To learn about publishing, see Publish Content.
When you publish, Paligo will send a JSON file to your Algolia instance. It will either:
-
Create a new index.
-
Recreate the entire index (if you have previously published this publication with Algolia enabled)
-
-
In Algolia, select your application and look at the Index section. It lists each index that has been created for your application.
By default, Paligo creates an index for each language that you publish. Each index name consists of a language code prefix and the UUID of the publication. For example:
en-UUID-817f5a19-d0db-0059-32e9-a958b958b9f85e62
Note
If your HTML5 layout is set to use a text name instead of the publication ID, the index will have that name. For details, see Custom Index Name for Algolia Search.
-
Select the link for the index for the publication you published.
Tip
To find the UUID of the publication in Paligo, select the dotted menu ( ... ) for the publication and then select Edit and then Open Structure. The UUID is shown in the publication's metadata.
-
Select the Configuration tab.
-
In the FILTERING AND FACETING section, select Facets.
-
Use the Add an attribute drop-down list to add the attributes for the filter categories. If Algolia does not include the required attributes in the list, there may be a problem with the Paligo-to-Algolia setup, see Test your Algolia Search.
-
For "flat" faceted search:
Add an attribute for each of the "parent" filter categories that you want to include. The drop-down list should include the facet names of your "parent" taxonomy tags. .
-
For "hierarchical" faceted search:
Add these attributes:
-
hierarchicalCategories.lvl0
-
hierarchicalCategories.lvl1
-
Note
If Algolia displays an "Unknown attribute" notification, ignore it.
-
-
Make sure the attributes are set to not searchable.
-
Select Review and Save settings.
-
Select the Browse tab to see a preview of the facets.
Note
The preview for "hierarchical" facets shows the structure of the facets, not how they will be presented in the output.
Your faceted search should now work with your published output. To try it out, see Test your Algolia Faceted Search.