mirror of
https://github.com/typesense/typesense.git
synced 2025-05-25 00:01:18 +08:00
Always use hash based faceting for small result sets.
This commit is contained in:
parent
a7adc1c3ca
commit
e9d46ccf90
@ -1281,8 +1281,9 @@ void Index::do_facets(std::vector<facet> & facets, facet_query_t & facet_query,
|
||||
// 2. Wildcard + no filters -> use value index
|
||||
// 3. Very few unique facet values (< 250) -> use value index
|
||||
// 4. Result match > 50%
|
||||
bool use_value_index = (group_limit == 0) && ( is_wildcard_no_filter_query || num_facet_values < 250 ||
|
||||
(results_size * 2 > total_docs));
|
||||
bool use_value_index = (group_limit == 0) && ( is_wildcard_no_filter_query ||
|
||||
(results_size > 1000 && num_facet_values < 250) ||
|
||||
(results_size > 1000 && results_size * 2 > total_docs));
|
||||
|
||||
#ifdef TEST_BUILD
|
||||
if(facet_index_type == VALUE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user