Understanding `facet_by` and `group_by` in Advanced Search
TLDR Emma queried about the function of facet_by
and group_by
in an advanced search scenario with structured data. Kishore Nallan clarified that facets during group_by
are done on the groups.
1
Aug 06, 2023 (4 months ago)
Emma
12:34 AMfacet_by
and group_by
are the facet counts the number of hits, or the number of groups?Emma
12:44 AM{
media_id: '123',
streaming: [
{ site: 'netflix', regions: ['us'] },
{ site: 'netflix', regions: ['ja'] },
{ site: 'hulu', regions: ['us'] }
]
}
Into multiple documents like:
{
media_id: '123',
streaming: {
site: 'netflix',
regions: ['us']
}
}
So that I can filter by, for example “available on netflix in the united states” like
<http://streaming.site:=netflix|streaming.site:=netflix> && streaming.regions:['us']
in the same object (ie, not matching 'us'
in one object and netflix
in another, the properties need to match the same object)I’d like the facets to reflect groups rather than hits, but I have a feeling they don’t
If there’s a better way to achieve this without denormalizing into multiple documents and grouping, please let me know 🙏
Emma
12:58 AMKishore Nallan
02:10 PM1
Typesense
Indexed 3011 threads (79% resolved)
Similar Threads
Understanding Facet Results in Typesense
Prabhu had difficulty understanding the count results of his facet results in Typesense. Kishore Nallan explained the behaviour and suggested creating a Github issue for a feature request to modify count behaviour.
Grouping and Faceting Denormalized Data
Phillip asked about grouping and faceting denormalized data. Viji provided a specific example for clarity. Jason confirmed Phillip's plan and suggested a different approach for consideration. Phillip acknowledged the advice.
Discussing Indexing and Filter Applications
Tugay and Kishore Nallan debated over latest RC build progress with several queries about field definitions and effect of filters on performance. A bug concerning multiple document matches was discovered and fixed.