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.