We store order data in a typesense index, includin...
# community-help
r
We store order data in a typesense index, including order value. I'm using the range slider widget from algolia to filter on this (attribute is a facet). The initial state is completely off though. The max value returned from the api is nowhere near the actual max. Once I started filtering on some other attributes/facets, the value becomes more accurate. Anyone know if this is a documented issue?
We store value as a float, not an integer. Not sure if that is relevant or not.
Ah it's because I need to define ranges up front in the facet_by query. Alternatively I could rewrite the widget to use filter_by instead of facet_by.. 🤔
j
Could you try setting
facet_strategy: exhaustive
as a search parameter to see if that fixes the max, min and avg values returned by Typesense?
The parameter is documented under this table: https://typesense.org/docs/27.1/api/search.html#faceting-parameters
r
Yeah, that did help. I did read the documentation for this setting already, but I thought exhaustive would be a bad pick here because the index will contain over 700k documents, and it says exhaustive is only effective with less than few tens of thousands of docs
j
Yeah it's a performance trade-off. But to calculate max, min and avg, we do need to access all documents to calculate these values for this particular query at runtime
r
I saw that query_by is on the roadmap for joins ( https://github.com/typesense/typesense/issues/1657 ) and an RFC for facetting by joined attributes ( https://github.com/typesense/typesense/issues/1706 ); does one imply the other, or are these separate features development wise?
j
These are two separate efforts, so will land separately