Displaying names for IDs in graphs

I found this issue mentioned in a few other (older) threads, but sadly without solutions and was wondering whether there was any way of doing this in the current version.

Problem: We process sales data for music artists. Every artist has a unique ID, and the data is indexed like

{
  sale_date: Date,
  artist_id: number,
  royalty: number,
  ...
}

What we would like to have is the artist names, rather than the artist IDs, in our graphs

While we could also add artist_name as a keyword, the issue is that artists regularly change their names, and we would like to always display the current artist name in graphs. This means that Kibana should map these IDs to names dynamically for display purposes.

What are my options there. We can easily get artist names by API call, have an external JSON file or have an extra index for ID => name mapping, but so far I haven't found any way to map this dynamically.

hi @ch_tom

Fundamentally, there's no real change. Adding artist_name to your document would still be the way to go if you would like to aggregate by this.

But Elasticsearch has added the match enrichment policy (https://www.elastic.co/guide/en/elasticsearch/reference/current/match-enrich-policy-type.html). It will allow you to maintain the artist_id and artist_name-relation in a separate index.

Usually, the enrichment processor is used at ingest time (adding a new document), but you could update your data using update_by_query on regular intervals to update your data.

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