Is there a way to count distinct records/documents that match a given condition?
I am aware that _search API with cardinality aggregation can be used for this.
But is there a way this can be achieved using _count API?
Is there a way to count distinct records/documents that match a given condition?
I am aware that _search API with cardinality aggregation can be used for this.
But is there a way this can be achieved using _count API?
Hey.
as the count API only returns the count of the search hits, but non of the aggregation results, you have to use the search API for this. You can use size: 0
to only show the aggregation results though.
--Alex
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.