Dynamic Filtering in Search Query
TLDR Babin asks how to use dynamic filtering in their search query. Jason explains that overrides should be created separately after creating the collection.
1
Mar 10, 2023 (7 months ago)
Babin
11:43 PM{
"q": "cheese",
"query_by": "description,brand,categoryName,sku",
"filter_by": "",
"page": 1,
"per_page": 30,
"sort_by": "description:asc",
"include_fields": "id,sku,description,categoryName,brand,packSizeDescription,images"
}
client.collections(collectionName).documents().search(searchParameters)
How do I use Dynamic Filtering ?
override = {
"rule": {
"query": "{brand} phone",
"match": "contains"
},
"filter_by": "brand:={brand}",
"remove_matched_tokens": true
}
// Creates/updates an override called `brand-filter` in the `companies` collection
client.collections('companies').overrides().upsert('brand-filter', override)
Do we have to add the overrides during collection setup?
Reference from: https://typesense.org/docs/0.23.1/api/curation.html#dynamic-filtering
Mar 11, 2023 (7 months ago)
Jason
12:11 AMBabin
02:44 AM1
Typesense
Indexed 2786 threads (79% resolved)
Similar Threads
Difficulty Creating Override on Typesense's Curation API
Kor was facing trouble while creating an override on Typesense and not getting expected results. Jason assisted in debugging the issue, provided a fix with an upgrade, and confirmed some limitations regarding case sensitivity and bulk deletion of overrides.
Troubleshooting 'Contains' Match and Override Issues in Typesense
John sought assistance due to a seemingly faulty override in Typesense that failed to bring up a specific entry. Jason suggested troubleshooting steps, including trying a smaller record set and considering a server upgrade. A bug with 'contains' match appeared identified but not conclusively resolved.
Troubleshooting Typesense Instantsearch Adapter's 'filters' Property
Carl was unable to use the `filters` property of Typesense Instantsearch adapter for network call. Jason suggested using a scoped API key to combine filters and also recommended experimenting with dynamic filtering rules for multiple product numbers. Carl is satisfied with these solutions.