Jamshid Hashimi
07/17/2023, 7:38 PM<ais-refinement-list attribute="countryofresidence" />
is not working in this situation. The reason is that I have countryofresidence
in my index 1 (collection 1) but not in my index 2. Is there a way make it that instantsearch ignores if index 2 doesn’t have that field or any other solutions?Jason Bosco
07/17/2023, 7:40 PMcollectionSpecificSearchParameters
config as described under this section: https://github.com/typesense/typesense-instantsearch-adapter#indexJamshid Hashimi
07/17/2023, 7:43 PMcountryofresidence
in my index 1, but not in index 2. In this situation, the search returns error, saying countryofresidence
is not present in index 2.Jason Bosco
07/17/2023, 7:44 PMJamshid Hashimi
07/17/2023, 7:47 PMconst typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
server: {
apiKey: import.meta.env.VITE_TYPESENSE_API_KEY, // Be sure to use an API key that only allows search operations
nodes: [
{
host: "x",
path: "", // Optional. Example: If you have your typesense mounted in localhost:8108/typesense, path should be equal to '/typesense'
port: "443",
protocol: "https",
},
],
cacheSearchResultsForSeconds: 2 * 60, // Cache search results from server. Defaults to 2 minutes. Set to 0 to disable caching.
},
// The following parameters are directly passed to Typesense's search API endpoint.
// So you can pass any parameters supported by the search endpoint below.
// query_by is required.
// Search parameters that are common to all collections/indices go here:
additionalSearchParameters: {},
// Search parameters that need to be *overridden* on a per-collection-basis go here:
collectionSpecificSearchParameters: {
main: {
query_by:
"Given Name, country of birth, countryofresidence, selfidentifiedasrefugee, mainoccupation, education, email 1, gender, jobpositions, language, last name",
},
kobo_updated: {
query_by: "group_un4zf56/Name, group_un4zf56/Last_Name_Family_last_Name",
},
},
});
const searchClient = typesenseInstantsearchAdapter.searchClient;
Jason Bosco
07/17/2023, 7:48 PMindex
widget? That’s the one that lets you scope refinement lists to the correct indexJason Bosco
07/17/2023, 7:49 PMJamshid Hashimi
07/17/2023, 7:54 PM<ais-instant-search :search-client="searchClient" index-name="main">
I didn’t see a need to use ais-index
but only when adding the next collection.Jason Bosco
07/17/2023, 7:56 PMais-index
is what gets Instantsearch to send the requests to multiple collections…Jason Bosco
07/17/2023, 7:57 PM<ais-index>
Jamshid Hashimi
07/17/2023, 7:58 PM<ais-instant-search
:search-client="searchClient"
index-name="instant_search_price_desc"
>
and later with the second index, they are using ais-index
.Jason Bosco
07/17/2023, 7:59 PMJamshid Hashimi
07/17/2023, 8:01 PM<ais-instant-search :search-client="searchClient" index-name="main">
<ais-index index-name="main">