Issue with Categories Facet in Typesense InstantSearch Adapter
TLDR David encountered an issue with not being able to add fields categories to facets. Kishore Nallan assisted in troubleshooting. After some back and forth communication, David finally managed to resolve the issue.
1
Nov 15, 2022 (11 months ago)
David
08:36 AMmaterials.lvl0
as a facet, that works just as expected. but i also have categories.lvl0
, categories.lvl1
, and categories.lvl2
added exactly the same way, marked with facet: true
in my schema and those categories doesn't show up here as options. This is using the typesense-instantsearch-adapter
and Instantsearch. I'm thinking it's something with max_facet_values
or something, but i cannot get it to workKishore Nallan
10:52 AMDavid
10:56 AM/collections
end-point response.{
"created_at": 1668508755,
"default_sorting_field": "priority",
"enable_nested_fields": false,
"fields": [
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "sku",
"nested": false,
"optional": false,
"sort": false,
"type": "string"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "productName",
"nested": false,
"optional": false,
"sort": true,
"type": "string"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "variantName",
"nested": false,
"optional": false,
"sort": true,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "colors",
"nested": false,
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "type",
"nested": false,
"optional": false,
"sort": false,
"type": "string"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "designer",
"nested": false,
"optional": true,
"sort": false,
"type": "string"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "tags",
"nested": false,
"optional": false,
"sort": false,
"type": "string[]"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "price",
"nested": false,
"optional": false,
"sort": true,
"type": "int32"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "inStock",
"nested": false,
"optional": false,
"sort": true,
"type": "bool"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "shipmentDate",
"nested": false,
"optional": true,
"sort": true,
"type": "int64"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "categories.lvl0",
"nested": true,
"nested_array": 2,
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "categories.lvl1",
"nested": true,
"nested_array": 2,
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "categories.lvl2",
"nested": true,
"nested_array": 2,
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "materials.lvl0",
"nested": true,
"nested_array": 2,
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "materials.lvl1",
"nested": true,
"nested_array": 2,
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "materials.lvl2",
"nested": true,
"nested_array": 2,
"optional": true,
"sort": false,
"type": "string[]"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "priority",
"nested": false,
"optional": false,
"sort": true,
"type": "int32"
}
],
"name": "Variants EU B2C 2022-11-15 10:39:14",
"num_documents": 1055,
"symbols_to_index": [],
"token_separators": []
}
David
11:00 AMthis one works
<RefinementList attribute="materials.lvl0" limit={100} />
while this one does not and is not included as a facet in the returned resultState :s
<RefinementList attribute="categories.lvl2" limit={100} />
Kishore Nallan
11:04 AMDavid
11:05 AMhere's how to replicate it.
- filter "Materials" to something. reload the page. notice the amount of search hits and the active filters before the client side js kicks in.
- add a "Categories" filter and do the same thing. notice the categories filter is not active until the client side js kicks in (that reads the query params in the url and updates the search)
Kishore Nallan
11:12 AMDavid
03:17 PM1
Typesense
Indexed 2779 threads (79% resolved)
Similar Threads
Troubleshooting Typesense Setup and Understanding Facets and Keywords
Demitri encountered errors when exploring Typesense for the first time. Jason guided them through troubleshooting and discussed facets, keyword settings, and widget configurations. Helin shared a Python demo app and its source code to help Demitri with their project.
Fixing Multiple Document Retrieval in Typesense
Phil needed an efficient way to retrieve multiple documents by id. Kishore Nallan proposed a solution available in a pre-release build. After some bug fixing regarding id matching by Jason and Kishore Nallan, Phil successfully tested the solution.
Typesense Products Filtering Issue with Mixed AND+OR Filtering
Dmytro faced issues in implementing mixed AND+OR filtering for product filtering on Typesense using `'typesense-instantsearch-adapter'` despite using several approaches and facets. Jason suggested increasing the number of facets fetched and trying a different server version but the issue remains.
User-Specific Tagging and Filtering in UI
bnfd asked for the best way to create user-specific tags available on the UI. Jason suggested using personalized filters and creating a separate collection for each user's movies. The duo clarified the use of 'tags' in schemas and the refinementList widget in instantsearch. They also discussed various approaches to import and search large document collections.
Facet Groups Filtering with Typesense and Instantsearch.js
Cristopher was having issues with faceting on Typesense and sought advice. Kishore Nallan and Jason provided recommendations and resources. Cristopher finally resolved the issue by switching to instantsearch.js.