Hey i have two questions which i think they are re...
# community-help
p
Hey i have two questions which i think they are related to each other. I have a search query with 3 facets. I am following a custom approach rather than using the typesense adapter and the algolia packages. I have successfully rendered the facets as checkboxes and when i select a facet i managed to send the value in filter_by. For example, filter_by: brand:=['Huawei', 'Apple']. The problem is that the initial query without filters brings back all the facets where the filtered query brings back less facets than the initial. On the contrary, when i inspect the example of the ecommerce store of typesense, i can see that multisearch is used and the search is broken to multiple search queries if a filter is present. Can you explain if there is a particular reason why the multisearch is used and if i must use it in order to bring consistent facets on each filter query? The implementation of the algolia instant search seems to be very abstract to follow.
j
Facets are essentially counts of all unique values in given result set. So if you apply a filter on a particular field and facet on it, it won’t include the other non-filtered values, since it’s not part of the result set. This is the reason for eg, in the ecommerce demo, the first search in the multi-search request does the query with the filter applied, then it does another query without the filter but with just the facet, to get facet counts for all values