Samir Kumar Sah
07/21/2024, 7:36 AMconst typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
server: {
apiKey: "{{ env('TYPESENSE_API_KEY') }}", // Be sure to use an API key that only allows searches, in production
nodes: [
{
host: '<http://aalambana.com|aalambana.com>',
port: '443',
protocol: 'https',
},
],
cacheSearchResultsForSeconds: 2 * 60,
},
// The following parameters are directly passed to Typesense's search API endpoint.
// So you can pass any parameters supported by the search endpoint below.
// queryBy is required.
// filterBy is managed and overridden by InstantSearch.js. To set it, you want to use one of the filter widgets like refinementList or use the `configure` widget.
additionalSearchParameters: {
query_by: 'name,category.level0,category.level1',
sort_by: 'is_featured:desc,_text_match:desc,updated_at:desc',
},
});