Hi there! What is the best option for a large amou...
# community-help
d
Hi there! What is the best option for a large amount of facet values (like hundreds)?
j
Do you mean hundreds of fields with faceting enabled in the schema, or do you mean hundreds of field in the facet_by parameter in a single search request?
d
If I understand you correctly, neither one nor other. I mean
facet_counts
, i.e. possible values for a facet, like ingredients here:
j
Ah I see, we call those facet values
Hundreds of facet values is completely fine
What matters is the total number of records, across all facet values for a single search query. When the result of a search query crosses say 10M results, we’ve seen it take a few seconds to compute those facet values…
Are you running into any issues?
d
I feel uncomfortable to set up
max_facet_values
to a big number and then get a few kb more with each request 🤔 My case is similar to “Brands” here, I have a few hundred thousands of documents and each has association with entity. I don’t really need counts itself, only unique values stored in the field
If I don’t need counts, maybe I can use something like query
*
+ group_by
entity
+ include
entity
to get all possible values for this field / search trough them? 🤔
j
You can only fetch a max of 99 groups though
set up max_facet_values to a big number
This would be the only way I can think of achieving what you’re trying to do
👀 1
I have a few hundred thousands of documents and each has association with entity
This should be fine
d
Got it, thank you
👍 1