Counting the duplicates and non-duplicates of a count aggregation (revisited)

Hello all,

My recently submitted topic was closed due to inactivity, but I just wondered if anyone else had any thoughts on it?

You can find the original post here - Counting the duplicates and non-duplicates of a count aggregation

Essentially, I'm trying to count the number of 'single instance' documents as one value, and the number of 'duplicate instance' documents as another value. Essentially a count of a count I believe.

Thanks in advance :slight_smile:

This is a use case for data transformations in ES. You can create a transformed index that uses the following settings:

  • Group by Terms of the ID
  • Cardinality aggs

The result should be documents containing something like { key: 'A', count: 3 } which you can then filter using the standard ES filters.

Hi Wylie Conlon,

Thank you for this! I've been sidetracked recently but I'm going to look into your suggestion in the next few days. I'll report back here on any progress.

Thanks

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