or am I even using facet_query properly?
# community-help
r
or am I even using facet_query properly?
k
Can you try setting
per_page
and
page
explicitly?
r
ya that works
thanks
k
Generally for facet query you don't care about results because it is a query on the facets of the query.
So keeping that in view, Typesense does not return results.
r
I see
so I am trying to get all the records that are in the category chair
is this the best way to go about it?
k
?filter_by=category: foo
r
so can you explain the difference between filter_by and facet_query
I don't think I'm understanding what facet_query does
k
filter_by
filters the actual results. It is equivalent to the WHERE clause in SQL.
Let's say you have an ecommerce shop and you have products from different brands. Lets say you search for shoes, and then facet on brands. This will return all shoe brands available with their corresponding counts. Now if you want to search within those facet brands, you will use facet query.
In the song search demo, facet query is used here to filter the genres here if the user types into the textbox.
r
ok I think I understand
so facet_query is like a search in the facet itself
but then if I do a filter by with a query: '*' wouldn't that be equivalent to a facet_query?
k
so facet_query is like a search in the facet itself
Correct. As for your second question, you can search on one set of fields and facet on another set of fields. They don't have to overlap.
r
I see. ok cool. Thanks @Kishore Nallan I'll play around with this a bit. appreciate your patience and time 🙂
k
Welcome.