Accurate count of distinct values

Hello,

I'm using elastic search in order to store information about search terms.
My document structure:

  • site
  • search term
  • date (year and month)
  • data1
  • data2

I have an index for each month.

For a given query with site and search term boolean search (substrings to include\exculde),
I want to get the number of search terms per number of words (without duplications), for example:

  • 5 search terms with 1 word
  • 10 search terms with 2 words.
  • total search terms: 15

I'm trying to use cardinality-aggregation (with precision_threshold = 40,000) but getting inaccurate numbers. In a single query, I may aggregate data over 360,000 search terms.
There is a way to get accurate result in my case?

Thanks,
Kobi

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.