How to count the instances of a particular field, across all documents, in a given Elasticsearch index.
For example, if I've got the following documents in index goober :
If you know field names at the time of constructing query, you can use exists query for each field. You can combine for multiple exists queries using multi search or nest inside filters aggregation
Unless you have turned off dynamic mapping, any document inserted or updated, can add more fields to the existing index mapping. So the listing of "all properties" can change by the time your query reaches server.
If you need it for a daily / weekly report, then you can write a small script to fetch index mapping using curl -XGET http://<host>:<port>/<index>/_mappings and then recursively extract properties to form the list.
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.