In order to scale, certain types of aggregations are approximate, and this includes the cardinality aggregation. You can tune the accuracy, but not get it absolutely accurate if your cardinality is quite high.
Document counts are accurate. The approximation only applies to a subset off aggregation types, and it is generally noted in the docs where values are likely to be approximate.
I can also update my query, because i need count so no need to sub aggs :slightly_smiling_face
"size": 0,
"aggs": {
"camgroup": {
"filter": {
"term": {
"RT": "184"
}
},
"aggs": {
"campevents": {
"terms": {
"field": "REE",
"size": 1000000
}
}
}
}
}
this will count accurate value..
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.