Use text field as label in data visualization


This is my first time using kibana, so sorry if this was asked before, but the threads I could find by searching were not helpful.

My use case is simple: I have an index that contains the fields movieId (integer), title (text), ratings_count (int). I want to make a visualization that shows me the top 10 documents, sorted descendingly by ratings_count. For example as a pie chart.

However, when I choose ratings_count as metric, and movieId as slice-by, there is no way to use my 'title' field anywhere, it is not even shown in the UI.

I can see the field in the Discover tab, wher everything is shown as a table. This works. but when creating a visualization, the field is hidden. All the previous threads said that you can use 'top values' to show text field, but this did not work for me.

This is what I have so far:

Thanks for reading!

Hello @marine.authorities, welcome to the community!

Even though it would be for the title, this is an aggregation-based visualization and by default, you cannot run aggregations on a text field. You can try creating a keyword sub-field instead, and then your string field could be mapped as a text field for full-text search, and as a keyword field for sorting or aggregations.