Toke Eskildsen <t...@kb.dk> writes:
> JSON faceting allows you to skip the fine counting with the parameter
> refine: 

I also tried the facet.refine parameter, but didn't notice any improvement.


>> I am wondering how I could filter the documents to get approximate
>> facets ?
>
> Clunky idea: Introduce a hash field for each document. [...]
> [...]you could also create fields with random values

That's a pragmatic solution. Two steps:
1. get the count, hightlight and first matches
2. depending on the count, filter based on random/hash values

BTW I wonder if the first step will be cached, as to get highlights I
cannot use FQ, but Q. And the latter is not meant to cache the
results. So this might lead to duplicate the effort isn'it ?


> It might help to have everything in a single shard, to avoid the
> secondary fine count. But your index is rather large

Yes, it's large, and growing from 1M each month. Merging in one shard is
not an option.

However, I suppose I should be able to ask the facet to one shard only
if the count is above a threshold ? This would reduce the number of
document by ~4 and avoid secondary fine count. That maybe better than
subsetting with extra random fields

-- 
nicolas paris

Reply via email to