#community-help

Implementing Category-Specific Filters with InstantSearch

TLDR Shadab asked about applying different filters to specific categories in InstantSearch for displaying different types of templates, but received no response.

Powered by Struct AI
Jul 24, 2023 (4 months ago)
Shadab
Photo of md5-41a24213179ff9ed2e32e727399ae6d1
Shadab
01:00 PM
Hi, Suppose I have 2 different pages where I need InstantSearch for displaying some templates. At one page I need to display All Templates and at another only the Trendy ones so I want to apply filter_by: "categories.name:=[trending]" Is it possible to do so with one client?

const additionalSearchParameters = {
  query_by: "store_name",
  num_typos: 2, 
  typo_tokens_threshold: 1,
};

export const searchClient = typesenseAdapter({ config, additionalSearchParameters }).searchClient;

const typesenseAdapter = ({ config, additionalSearchParameters }) => {
  return new TypesenseInstantsearchAdapter({
    server: config,
    additionalSearchParameters,
  });
};

If I add filter_by: "categories.name:=[trending]" in additionalSearchParameters I will get trending no of templates at all places. Pls refer any doc I can use for this purpose. Thanks!
Jul 25, 2023 (4 months ago)
Shadab
Photo of md5-41a24213179ff9ed2e32e727399ae6d1
Shadab
05:19 AM
Kishore Nallan / Jason any update here?