I have a client who is using facets for their location vertical (think ATM, Branch, Surcharge-free atm, etc…). Right now it looks like the facets show up in an order based on which facet has the most relevant results. So for example:
Surcharge Free ATM (25)
My client has asked whether or not we can customize this order, because they would ideally like “Branches” to show at the top. What do you think?
Unfortunately no, currently there is no way to control the order in which facets options appear. We hear you, though, and we’re considering ways to make facet order configurable.
The name (i.e. “Answers Specialty”) of the facet filter pulls directly from the Display Name of the field itself, so you’d have to change that in your account settings. There is no way to override it on the front-end.
Thanks for following up! I did see this code in the Answers ReadMe, however, which caused me a bit of confusion. This code implied you can customize. Or is this for static filters and not facets? It’s hard to tell!
Correct! Those are static filters. Since static filters do not depend on the query itself and are defined client-side, on the page, you can customize everything about them - their order, labels, etc. Facets, on the other hand, are returned by the server and depend on the query, so we haven’t yet created a mechanism for controlling the order in which they appear. It’s on the roadmap, though!
Ah I see! To clear up any confusion, when I say facets I mean the overarching field (i.e. Insurance AcceptedI) and when I say facet options I mean the individual options within it (i.e. Aetna, Cigna etc.)
But alas, today you cannot control the order of either of these things. What’s on the more immediate roadmap is to control the order of the facets. As you point out, you should be able to make Specialty appear first or Gender appear last. Important facets should be first; unimportant ones should go last.
Controlling the order of facet options is not something that is currently on the roadmap, but we would be interested to hear about the use case!
Are there any updates on being able to change Facet Names in the Search Configuration? We currently use naming conventions for the “Display Name” in the KG and wouldn’t want those to display on the FE of answers
Controlling the order of facet options is not yet supported but on the product roadmap. We recommend making your facet options searchable in the meantime, which will allow a user to type for an option. There is more info in the facets component section of our Github documentation.
Wanted to follow-up on Ella’s previous question - do we have any update on timing for when ordering options within a facet will be enabled? And will that ordering be customizable, or will it be limited to only alphabetical ascending/descending?
In case anyone needs, you can update the overarching facet order by going to Search > Your Search Experience > Edit as JSON and finding the vertical you’d like to change the facet order for. Add the following code within the vertical; make sure that you’re using the field API name (i.e. address.postalCode):