Percentage of documents that have a given field value


#1

I have documents that contain several boolean fields. For each of those fields I want to know what percentage of documents have it set to true. Can elasticsearch tell me?


(Rahul Desai) #2

You can perform terms aggregation on each field that you want the fill rate for and calculate it using the values returned by elasticsearch each bucket. You'll have to use the other document count value if some of the documents do not contain this field.


(system) #3

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