typesense / typesense-instantsearch-adapter

A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Removing options from search on adapter

albavilanova opened this issue · comments

Description

Hi,

I would like to avoid doing unnecessary searches by removing certain options (products in my case) in advance. I have a list of products per city, and want to search only the products for a specific location. Would it be possible to remove the cities in advance in the definition of the adapter?

Thanks in advance,

Alba

Steps to reproduce

I am using react-instantsearch. My adapter looks like:

const typesenseInstantSearchAdapter = new TypesenseInstantSearchAdapter({
  server: {
    apiKey: 'xyz',
    nodes: [
      {
        host: 'localhost',
        port: 8108,
        protocol: 'http',
      },
    ],
    cacheSearchResultsForSeconds: 2 * 60,
  },
  additionalSearchParameters: {
    query_by: 'name',
    query_by_weights: '1',
  },
});

Typesense Version: 1.7.2

OS: Ubuntu 20.04.6 LTS

You want to use a default filter for this.

Here's a detailed thread discussing this: #17

Thank you Jason, that helped.