-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
how to use multiple instant search client in the same form? #194
Comments
If these are separate InstantSearch instances, then you want to use separate typesense-instantsearch-adapter instances with their own settings as well, so there's no interaction between these two instances. If these are the same InstantSearch instances, then you you want to use this mechanism to specify settings for each collection using |
hmm i think there are considered separate instantsearch instances. We created a which contains an InstantSearch react component for each of these components. sample code:
do you know how do i check if a typesense instantsearch adapter is its own instance or a shared one? cos from this code it seems like it should always create a new instance everytime. |
To create a separate typesense-instantsearch-adapter instance, you want to instantiate two separate instances of the class. const typesenseInstantSearchAdapterEmployees = new TypesenseInstantsearchAdapter(typesenseAdapterOptionsForEmployees);
const typesenseInstantSearchAdapterReceipts = new TypesenseInstantsearchAdapter(typesenseAdapterOptionsForReceipts); And then in each Instantsearch instance: <InstantSearch
searchClient={typesenseInstantSearchAdapterEmployees.searchClient}
indexName={'employees'}
{...instantSearchProps}
future={{ preserveSharedStateOnUnmount: true }}
>
<Error />
{children}
</InstantSearch>
<InstantSearch
searchClient={typesenseInstantSearchAdapterReceipts.searchClient}
indexName={'receipts'}
{...instantSearchProps}
future={{ preserveSharedStateOnUnmount: true }}
>
<Error />
{children}
</InstantSearch> |
I'm not too familiar with React, so I can't speak to the use of |
Description
Hi, we were wondering how do we have multiple instant search clients (Typesense Wrapper int he screenshots) co-existing and working in the same form.
One instant search client points to an employee index in the participants field. Another one only instantiates in the modal and is pointing to the receipts collection.
We found that the the 'query_by' in the employee index gets overriden by the receipts server adapter options when the modal is activated and then closed.
both instantsearch clients uses their own server adpater options object. How do we prevent overrides like this?
initial correct payload:
After modal is activated and closed, we saw this console error:
employee index payload after modal is open and closed:
Notice how filename is in query_by but this shouldn't be the case, and should be the same as initial correct payload
The text was updated successfully, but these errors were encountered: