-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling facet counts when there are disjunctive filters within a filter, across a set of conjunctive faceted filters. #1580
Comments
Hey! I believe this would be handled in this package, and @Haroenv might be able to exactly point out that logic |
relevant code here: https://github.com/algolia/instantsearch/blob/master/packages/algoliasearch-helper/src/requestBuilder.js for computing the queries, and https://github.com/algolia/instantsearch/blob/master/packages/algoliasearch-helper/src/SearchResults/index.js (big file, it's in many parts of it) for reading it in the end. I recommend you just use the helper or InstantSearch though, this is complicated code that you'd rather have vendored IMO |
@Haroenv Gotcha - I wound up looking at how the requests were built in an InstantSearch demo and got what I needed. At first I was hoping there was a way to handle this without creating several requests (or even any additional requests), but I see we can send them all at once to your API, so that's cool. 👍 We probably should use your libraries (and I may look into that helper if I can get the OK to add the dependency), but to be honest, we may not use Algolia in the future for cost reasons (nothing personal! it's just the state of the world!), so we'd rather not get too dependent on things outside of the main search functionality you provide if we decide to use a different service, since there are many similar versions out there and refactoring the search itself wouldn't be too hard, but I'm not so sure about the Thanks for responding and for the help, I really appreciate it! I'll go ahead and close this. |
I noticed this quote in an issue from a few years back
Originally posted by @Haroenv in #1404
My understanding was that handling disjunctive facet counts is only managed via InstantSearch according to Algolia's documentation https://support.algolia.com/hc/en-us/articles/11923043923217-How-can-I-configure-my-facet-attribute-as-conjunctive-AND-disjunctive-OR
We are not using InstantSearch, and I am trying to figure out how Algolia handles disjunctive facet counts so that I can replicate it in my application. I've gotten close with my own second request that I've added, where I effectively exclude the last applied filter, but I'm finding edge cases (particular initially accessing a page with filters applied (e.g. query params), and feel like if it's a solved problem on your end, it would be great to utilize your solution without having to use InstantSearch components.
Could you help me understand how that second request is made using your client? Or show me where in InstantSearch it is handled? Happy to share more details if that would help contextualize my issue.
Just to clarify, this is a set of search filters, all conjunctive, but options within each search filter are disjunctive.
The text was updated successfully, but these errors were encountered: