Rob Bast
06/24/2025, 9:47 AMfacets with type object and then facets.* which has facet set to true and type string[]. we then map our data by (simplified example) facets = {property.slugified(): values[]} - however, we'd like to show the actual property name for the facet, not the slugified version. is it possible to maybe specify our schema as facets.*.name type string, facets.*.values as type string[] and then somehow let typesense know that the values for facet.X are in facet.X.values? does this make sense? 😅 Or maybe you could suggest a completely different way to solving our issue?Kishore Nallan
06/24/2025, 11:20 AMfacet_return_parent parameter?Rob Bast
06/24/2025, 11:20 AMKishore Nallan
06/24/2025, 11:22 AMcolor.name you can do:
"facet_return_parent": "color.name"
This will return the parent color object as parent property in the facet response.Rob Bast
06/24/2025, 11:22 AMfilter_by: category:X and facet_by: * search to get a list of all facets applicable to the products in given category, so I can dynamically created facet widgets for the relevant facetsRob Bast
06/24/2025, 11:22 AMKishore Nallan
06/24/2025, 11:22 AMRob Bast
06/24/2025, 11:24 AMRob Bast
06/24/2025, 11:24 AMRob Bast
06/24/2025, 11:26 AM{
"facet_counts": [
{
"counts": [
{
"count": 7,
"highlighted": "Plamuren",
"value": "Plamuren"
},
...
],
"field_name": "facets.toepassing.value",
"sampled": false,
"stats": {
"total_values": 5
}
},
{
"counts": [
{
"count": 12,
"highlighted": "Gelcoat & Topcoat",
"value": "Gelcoat & Topcoat"
},
...
],
"field_name": "facets.type-product.value",
"sampled": false,
"stats": {
"total_values": 8
}
},
{
"counts": [
{ "count": 32, "highlighted": "RESION", "value": "RESION" },
...
],
"field_name": "brand",
"sampled": false,
"stats": {
"total_values": 5
}
}
],
"found": 48,
"hits": [
{Rob Bast
06/24/2025, 11:27 AMfacets.toepassing.value , facets.type-product.value and for brand (this last one we i18n in the frontend).Rob Bast
06/24/2025, 11:27 AMfacets.X.nameKishore Nallan
06/24/2025, 11:31 AMfacet_return_parent=facetsRob Bast
06/24/2025, 12:07 PMRob Bast
06/24/2025, 12:09 PM/search?q=*&query_by=name&filter_by=category_normalized:Polyester&sort_by=&facet_by=*&facet_return_parent=facets i'm not really seeing anything different in the response payloadRob Bast
06/24/2025, 1:36 PM/search?q=*&query_by=name&filter_by=category_normalized:Polyester&sort_by=&facet_by=*&facet_return_parent=facets.toepassing.value,facets.type-product.value but that is problematic because I do not know which facets are returned up front. i'd have to issue multiple queries to finally be able to start creating an overview of the producs within a certain category and their respective facetsKishore Nallan
06/24/2025, 1:41 PMRob Bast
06/24/2025, 1:42 PMRob Bast
06/24/2025, 1:43 PMKishore Nallan
06/24/2025, 1:43 PMfacet_return_parent unfortunately requires an explicit reference to a concrete child field value right now.Rob Bast
06/24/2025, 1:44 PMKishore Nallan
06/24/2025, 1:44 PMRob Bast
06/24/2025, 1:44 PMJason Bosco
06/24/2025, 2:23 PM{
"facets": {
"Facet Field A 123": [
"Value 1",
"Value 2"
],
"Facet Field B 456": "Value 3"
}
}
Notice the spaces in the field values. It looks odd, but this worksRob Bast
06/24/2025, 2:24 PMJason Bosco
06/24/2025, 2:25 PMRob Bast
06/24/2025, 2:26 PMJason Bosco
06/24/2025, 2:26 PMJason Bosco
06/24/2025, 2:27 PMfacet_return_parent would be helpful for dynamic faceting.
We added facet_return_parent to solve for not having to do these extra steps and that works for non-dynamic facets currently. So would be good to extend that same mechanism to work with dynamic facets as wellRob Bast
06/24/2025, 3:25 PMRob Bast
06/24/2025, 3:29 PMRob Bast
06/24/2025, 3:37 PMJason Bosco
06/24/2025, 4:03 PMJason Bosco
06/24/2025, 4:03 PMRob Bast
06/24/2025, 6:44 PMRob Bast
06/24/2025, 6:44 PM