robert
08/03/2022, 9:24 PMreact-instantsearch
? I have two collections that I would like to combine results for. They have different fields in each collection though. Do I need to do some kind of overriding of the react-instantsearch-hooks-web
to support federated multisearch? Any ideas on where I would want to inject in this call?
I see support for this was built into the typesense react instant search adapter but I don't see any documentation on how to make a federated search possible. Is there documentation I can look at or could someone perhaps point me in the right direction?robert
08/03/2022, 9:33 PMrobert
08/03/2022, 9:39 PM// Search parameters that are common to all collections/indices go here:
additionalSearchParameters: {
query_by: "",
},
// Search parameters that need to be *overridden* on a per-collection-basis go here:
collectionSpecificSearchParameters: {
snippets: {
query_by: "answer,name",
query_by_weights: "2,1",
},
searchable: {
query_by: "text,context",
query_by_weights: "2,1",
},
},
Now I'm working out some of the kinks in having multiple Index
within the InstantSearch
robert
08/03/2022, 9:47 PMrobert
08/03/2022, 9:48 PMJason Bosco
08/03/2022, 10:21 PMcollectionSpecificSearchParameters
is the way to go.
The undefined behavior sounds strange. Could you try using the latest version of the instantsearch adapter and at least Typesense 0.23.1 to see if you can replicate the issue?Jason Bosco
08/03/2022, 10:21 PMrobert
08/03/2022, 10:59 PMJason Bosco
08/03/2022, 11:01 PMrobert
08/03/2022, 11:01 PMJason Bosco
08/03/2022, 11:05 PMJason Bosco
08/03/2022, 11:05 PMrobert
08/03/2022, 11:15 PMJason Bosco
08/03/2022, 11:23 PMrobert
08/03/2022, 11:32 PMJason Bosco
08/03/2022, 11:39 PMrobert
08/03/2022, 11:41 PMrobert
08/03/2022, 11:42 PMJason Bosco
08/03/2022, 11:49 PM<Highlight />
component. By default Typesense snippets results. So when you use <Highlight />
, the field it’s looking for doesn’t exist in the Typesense response and it displays as undefined.
If you add a param called highlight_full_fields
like below, you should then start seeing the highlights instead of undefined.
collectionSpecificSearchParameters: {
snippets: {
query_by: "answer,name",
query_by_weights: "2,1",
highlight_full_fields: "answer,name",
},
searchable: {
query_by: "text,context",
query_by_weights: "2,1",
highlight_full_fields: "text,context",
}
}
robert
08/03/2022, 11:50 PMJason Bosco
08/03/2022, 11:51 PMrobert
08/03/2022, 11:52 PMrobert
08/03/2022, 11:52 PMquery_by
setup highlight full fields is set?Jason Bosco
08/03/2022, 11:52 PMJason Bosco
08/03/2022, 11:52 PMJason Bosco
08/03/2022, 11:58 PMrobert
08/03/2022, 11:59 PMquery_by
). strange edge caseJason Bosco
08/04/2022, 12:00 AM<Snippet />
will work by default, since Typesense snippets all query_by fields without additional configuration