Is it possible to show the full list of Refinments always?

Imaging we have two RefinementLists, Gender[Male, Female] and Role[Dev, QA], If we selected Male as Gender, and in the result list there is no QA, the Role Refinement List will only show Dev.

Is it possible to not let the refinement list affect each other?

Thanks.

1 Like

Hello,

I think that always displaying all values would be a bit confusing maybe from a user point of view.
I don’t think that is even possible currently with the libraries we have.

However here is a potential alternative solution you might find interesting:

I hope that helps,

1 Like

Thanks @rayrutjes
I tried this solution, but seems it has a limit of 100 for each facet.
100 is a little bit small, as we want to put the facet into a dropdown list, and then user can select from there.

I tried with another way, just query the search method, like this:

searchClient
.search([
{
indexName,
params: {
facets: [‘brand’, ‘categories’],
hitsPerPage: 1,
maxValuesPerFacet: 2000
},
},
])

I got 1000 for each facet, I 'm not sure if I hit another limit.
but anyway we won’t show all the items if there are several thousands of them.
Do you have any concern about this way?

Thanks.

Hi there,

1000 facets max is a hard limit set by the Algolia engine for performance, so you won’t be able to get around that. See documentation:

100 values for a dropdown / select type widget is already a lot, unless you make it searchable in which case searchForFacetValues would again be a good candidate.

Otherwise , your workaround should work, at the expense of exhaustivity if you have more than 1000 different values for a given facet.

I hope this helps!