We are struggling to get our object structure setu...
# community-help
n
We are struggling to get our object structure setup to support querying facets (ex.
OLED
), which are optional attributes contained within a corresponding facet group (ex.
TV Type
) where we might not have the group id available ahead of time. We’d like to be able to see a url, extract off the facet ids which look like this or this or this (only facet id available for some facets). This url structure is a legacy one and will not use redirects due to seo reasons, so we are trying to make this work. So, we have
Facet Groups
with a
name
and
id
and
Facets
with a
name
and
id
. We want to be able to filter using the facet ids parsed off of the url, but get the facet counts back associated with the facet group name. These facet groups can be added dynamically and are typically associated with a category like TVs in this example, but don’t have to be. So, we don’t know ahead of time how many facet groups or facets there will be that are returned. Are there any examples of how the typesense objects could be formatted to support this kind of filtering? It seems like this must be a pretty common case for ecommerce faceted search.
j
You can set the facet_by search parameter in Typesense dynamically at search time, to get facet counts for just the fields mentioned in that parameter