Handling Two Collections in One Filter Widget with React-InstantSearch
TLDR Lina wanted to handle two collections in one filter widget. Jason suggested that react-instantsearch doesn't support this and a custom widget might be needed.
Mar 01, 2023 (9 months ago)
Lina
12:04 PMI've got a question. I need to handle 2 collections in 1 filter widget. Could you tell, is it possible?
So I have two collections with similar fields. For example:
collection_1 : id, category, status ...
collection_2 : id, category, status ...
Category may have different values. One of the possible values is General.
I need:
1. Show General option in the filter
2. When this option is selected, show General items from collection_1, but don't show General items from collection_2
Right now I came up with this solution: I'm displaying filters from collection_1, so the General option is visible there. But when I'm selecting this option, I receive hits from collection_2 with category = General as well. I need only hits with category = General from collection_1 :melting_face: Please help
Kishore Nallan
12:40 PMLina
12:42 PMKishore Nallan
12:44 PMLina
12:45 PMJason
05:18 PMJason
05:18 PMLina
05:21 PMTypesense
Indexed 3011 threads (79% resolved)
Similar Threads
Resolving 'stores_count' field sorting issue in Schema
em1nos encountered an issue sorting the 'stores_count' field, which was due to a field disparity in multiple collections. Upon resolving that, a subsequent issue with instant search internally managing sorting came up, which Jason addressed by releasing an updated version of the adapter.
Combining ReactInstant Search Widgets with React Hook Form Version
Uma asks if they can combine ReactInstant Search widgets with React Hook Form version widgets. Jason suggests asking in the Instantsearch github repo, but suspects they'd need to switch all widgets to the hooks version.
Fixing Multiple Document Retrieval in Typesense
Phil needed an efficient way to retrieve multiple documents by id. Kishore Nallan proposed a solution available in a pre-release build. After some bug fixing regarding id matching by Jason and Kishore Nallan, Phil successfully tested the solution.
Typesense Products Filtering Issue with Mixed AND+OR Filtering
Dmytro faced issues in implementing mixed AND+OR filtering for product filtering on Typesense using `'typesense-instantsearch-adapter'` despite using several approaches and facets. Jason suggested increasing the number of facets fetched and trying a different server version but the issue remains.
Resolving Issue with Instantsearch Sort_by in React
Edward had a problem with sorting functionality in a React component using Algolia's InstantSearch. Jason recommended a potential solution for specifying index names which resolved the issue.