Add unique value for each fields

I have a index something like this:

All countries' names, along with their populations, exist in my index. Since Kibana does not allow us to use the countries' normal names, I have to add unique country codes such as FR, KR, TR....

Could it possible? How to cope with it?

Where can you not use the normal (I assume full) name of countries in Kibana?

I guess it's for maps when you want to highlight the country and you don't have a geo point.

You can provide a synonym list which converts each country name as its ISO code (I d apply this analyzer to a new sub field like country.code) or use an ingest pipeline to create a new field like country_code.
.

On kibana, when i try to create a choropleth map, if i choose the world countries option;

it displays this message.

I shouldn't convert country fields to their ISO code. I must add extra fields for this. I guess i should use enrichment data but I don't know how can i provide this.

Could you explain gradually?

Some doc about synonyms here: Synonym token filter | Elasticsearch Guide [8.8] | Elastic

Some doc about ingest pipelines here and the enrich processor here: Enrich your data | Elasticsearch Guide [8.8] | Elastic

Hope this helps.

2 Likes

Another option is a runtime lookup field might be a good way to test see if it works for you, you might need to add it to the mapping not data view for it to work in a map ...you need to check that, I have not tried that yet.

Probably the best approach is the enrich processor that @dadoonet suggested.

1 Like

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