I have trouble to create chart with "Metric - Slice size". I want to use the count aggregate with a specific property ( like unique count) but there's no options for it.
just to make sure I am understanding you right, you would like the above data to produce 4 slices (one for A, B, C and D and give each the size in relation to the amount of different "customer_id" values they had?
If so you can easily create a pie chart, and Use "Terms" aggregation on category for the "Split Slice" bucket, and on the metrics side select "Unique Count" on that customer id field.
Could you perhaps provide for the example data above which slices you actually want to have in the pie, and which values should be attached to that slices, since I unfortunately don't understand exactly which order you want to have. Because if you want to see how many times a customer selects a category, that sounds more like you want the customer on the slice level?
In this case you could still use count, but just add a filter to the visualization, for customer_idexists. That way you will filter out all documents before aggregating, that doesn't have the customer_id field!
I'm glad we could solve it that easily. Please always feel free to come back with further questions (ideally in new threads, if they are about different topics).
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.