Count elements within array

Hey all,

Let's assume that I have the elasticsearch index "courses", that contains the fields: name (string), tags (array)

Courses:
|name | tags|
|courseA | [java,web]|
|courseB . | [python, web]|
|courseC |[python]|

I would like to create in Kibana a visualize component (for example pie-chart), that will count me the number of courses that appeared for each tag

For example:
web 2
java 1
python 2

Note: I am also fine with splitting the tag array field into two separated fields (tag1, tag2) if that will simplify things...

Please advise :slight_smile:

Thanks, Eviatar

Hey @eviatenne, if you create a pie chart that uses a terms aggregation on the tags field, you'll get what you're looking for:

Thanks, this was exactly what I was looking for!

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