Orderable Facets

What is an orderable facet?

Currently, the Answers experience lets an admin specify a special type of dynamic filter called a facet. These filters are incredibly useful for offering searchers the best way to refine results to fit their needs. However, in its current implementation, the order in which facets appear is decided on the backend, which can give an Answers admin limited visibility into how easily a searcher refines.

Orderable facets now allow admins to control the order of facets they select to call out the most important filters they want searchers to see. Now, when someone is searching for doctors in a location, the Answers experience can return specialty and insurance first, or whatever else fits their business’s need!

How are orderable facets set?

Orderable facets are set in the search config, by vertical. A new field called facetOrder has been added to the search config, and ordering the facets is as simple as specifying the fields in the order you would like them to appear. The only requirement here is that a specified field under facetOrder must have “facet” set to true. Please see below for an example of what a vertical might look like:

{
"$schema": "https://schema.yext.com/config/answers/answers-config/v1",
"$id": "test_experience",
"name": "Test Experience",
"supportedLocales": [],
"countryRestrictions": [],
"verticals": {
    "products": {
        "searchableFields": {
            "c_benefits": {
                "facet": true
            },
            "c_brand": {
                "facet": true
            }
        },

        // New facetOrder attribute
        "facetOrder": [
            "c_benefits",
            "c_brand"
        ]
    },
    "faqs": { ... }
},
"autocomplete": { ... },
"synonyms": { ... },
"localizations": { ... },
"rules": [ ... ],
"additionalStopWords": [ ... ],
"querySuggestions": { ... },
}


Fig: Filters will show up in the order you specify

These facets will then be displayed in the order that the admin prescribes! Any facets that appear on a given search that are not stated in the facetOrder field will be shown in an arbitrary but consistent order, chosen by the algorithm.

1 Like