Running Multiple Facet Queries Simultaneously
TLDR Stefan asked about running multiple facet queries, Kishore Nallan suggested using multi_search with a facet_query for each facet as a workaround.
Powered by Struct AI
4
19mo
Mar 31, 2022 (19 months ago)
Stefan
Stefan
11:41 AMIs there a way to run mutliple facet queries for multiple facets?
As in, I can specify:
But I can only have one facet_query: "category:shoe" as far as I see. Doing
As in, I can specify:
"facet_by: "category,container,x,y,z"
But I can only have one facet_query: "category:shoe" as far as I see. Doing
"category:shoe,cotainer:can".
Is that correct?Kishore Nallan
Kishore Nallan
11:49 AMThere's no way to run multiple facet queries. Mostly because in the user interface, you tend to use it primarily for filtering within returned facets, and that's usually done on any one field only, and not on multiple fields at the same time.
Stefan
Stefan
11:53 AMTrue, but I would like to implement the following use case:
I have a search bar and as the user types, I'd like to search for products with the search term in it.
At the same time I'd like to do a facet_query to suggest filters, for example someone searches for "vitam", I would like to suggest "vitamin c" as a filter option.
Is there a better way to implement this?
I have a search bar and as the user types, I'd like to search for products with the search term in it.
At the same time I'd like to do a facet_query to suggest filters, for example someone searches for "vitam", I would like to suggest "vitamin c" as a filter option.
Is there a better way to implement this?
Kishore Nallan
Kishore Nallan
12:00 PMYou can always use multi_search with N facet_queries, one for each facet. That's a work around, but eventually, yes we could support having multiple facet queries in a comma separated list as you've given above.
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2786 threads (79% resolved)
Similar Threads
Facet Query Multiple Facet Filtering Syntax
gab needed assistance with filtering multiple facets and facet-values using facet_query, but managed to find a solution independently.
2
25mo
Solved
Understanding Multisearch in Typesense
Pantelis needed clarity on multisearch behavior in typesense. Jason explained it's used to get consistent facets for all filters.
2
2mo
Solved
Retrieving Facets Without Filters
Amrit wanted to retrieve facets without filters. John and Kishore Nallan suggested using parallel requests or `multisearch` endpoint.
9
4mo
Solved