Is it possible to get the facet count while ignoring the effect of filtering by a facet

My objects have a type attribute with values like “document”, “form”, “ticket”, etc. When I query with facets: [ 'type' ] I get the count of objects for each type correctly. When a user filters by type, is it possible to continue to get the facet counts for type without the effect of the filter?

For instance, if there are 3 “documents” and 0 “forms” and the user chooses “forms”, I’d like the count of “documents” to still read “3”. I figure I can send 2 queries at once, one to get the counts with no filter applied and one to get the results … just wondering if there is a better way?

Hello @robert.reinhard

Yes you are right, you need to send 2 queries at once, one to get the results and one to get the full facets values. There is no way for the engine to answer with facets values not matched by the query.

Did I answered your question? Feel free to ask us anything else.

Cheers, Maxime.

Don’t update facet list after search and get facets only on first time you call api to show list