# Kibana - Translate Filter Options

**URL:** <https://discuss.elastic.co/t/kibana-translate-filter-options/223930>\
**Category:** Kibana\
**Created:** [March 17, 2020, 1:24pm UTC](https://discuss.elastic.co/t/kibana-translate-filter-options/223930 "2020-03-17T13:24:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charlz/32/70782_2.png) [@charlz](https://discuss.elastic.co/u/charlz)\
**Post date:** [March 17, 2020, 1:24pm UTC](https://discuss.elastic.co/t/kibana-translate-filter-options/223930/1 "2020-03-17T13:24:49Z")

</div>

Hi,

I am using 7.6 version  
I have a use case, in an Index, a Field will have Integer values, it has to mapped to Text when displayed as Filter in Kibana and this Text will also need to be translatable in two languages.  
eg:  
Index : sample (with field status)  
status: 1,2,3

When I display filter in Kibana, Status need to be [1:WON,2:REJECTED,3:CANCELED]

Is this possible in the Kibana? I have checked the Translation plugins which translates the Kibana Application only.

Is there feature/plugin to achieve this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [March 17, 2020, 2:21pm UTC](https://discuss.elastic.co/t/kibana-translate-filter-options/223930/2 "2020-03-17T14:21:10Z")

</div>

Hey @charlz, welcome to the discussion boards!

Kibana can't translate your user-supplied data on its own, but you can accomplish this with [data enrichment](https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest-enriching-data.html) when you ingest the data into Elasticsearch.

There are a couple of high-level steps:

## Define an enrichment index

This index will be a mapping between your status id, and the various translations you're interested in. I chose English and Spanish, but you can do whatever you'd like. Here is an example of the three status codes you provided, being created in the `enrich_status` index:

```auto
POST enrich_status/_doc
{
  "status": 1,
  "status_en": "WON",
  "status_es": "GANAR"
}

POST enrich_status/_doc
{
  "status": 2,
  "status_en": "REJECTED",
  "status_es": "RECHAZADA"
}

POST enrich_status/_doc
{
  "status": 3,
  "status_en": "CANCELED",
  "status_es": "CANCELADA"
}

```

## Create an enrichment policy

I followed [this example](https://www.elastic.co/guide/en/elasticsearch/reference/master/match-enrich-policy-type.html) to create a policy to match based on the `status` field:

```auto
PUT /_enrich/policy/status-policy
{
    "match": {
        "indices": "enrich_status",
        "match_field": "status",
        "enrich_fields": ["status_en", "status_es"]
    }
}

POST /_enrich/policy/status-policy/_execute

PUT /_ingest/pipeline/status_lookup
{
  "description" : "Enriching status details",
  "processors" : [
    {
      "enrich" : {
        "policy_name": "status-policy",
        "field" : "status",
        "target_field": "details",
        "max_matches": "1"
      }
    }
  ]
}

```

## Ingest your data

Now, when you index data into Elasticsearch, specify the `status_lookup` pipeline:

```auto
PUT /my_charlz_index/_doc/my_id?pipeline=status_lookup
{
  "status": 1
}

```

Then, when you search this index, you'll find that all the relevant details from the `enrich_status` index have been copied into your target index:

```auto
GET /my_charlz_index/_search

```

```auto
{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "my_charlz_index",
        "_type" : "_doc",
        "_id" : "my_id",
        "_score" : 1.0,
        "_source" : {
          "details" : {
            "status_es" : "GANAR",
            "status_en" : "WON",
            "status" : 1
          },
          "status" : 1
        }
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![charlz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charlz/32/70782_2.png) [@charlz](https://discuss.elastic.co/u/charlz)\
**Post date:** [April 14, 2020, 6:30am UTC](https://discuss.elastic.co/t/kibana-translate-filter-options/223930/3 "2020-04-14T06:30:56Z")

</div>

Thanks @Larry_Gregory.

Considering the factor of using the Ingest might be expensive in-terms of Indexing Document, if the Document is structured with similar way without using Ingest will that be good solution to be considered instead of Ingest(Enrich)? . Your thoughts please?

```auto
 POST enrich_status/_doc
{
  "status": 1,
  "status_en": "WON",
  "status_es": "GANAR"
} 

```

```auto
POST enrich_status/_doc
{
  "status":{
       "status_value": 1,
       "status_en": "WON",
       "status_es": "GANAR"
   }
} 

```

Does this Document Structure or using the Ingest(Enrich) on Field will help in building the Dashboards much better in terms of indexing and performance?

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [May 5, 2020, 6:20pm UTC](https://discuss.elastic.co/t/kibana-translate-filter-options/223930/4 "2020-05-05T18:20:57Z")

</div>

Sorry for the delayed response. Yes, if you're able to change the structure of the document you're ingesting, then that would be more performant than asking Elasticsearch to do so at ingest time

---

<div class="post-metadata">

**Author:** ![charlz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charlz/32/70782_2.png) [@charlz](https://discuss.elastic.co/u/charlz)\
**Post date:** [May 12, 2020, 9:30am UTC](https://discuss.elastic.co/t/kibana-translate-filter-options/223930/5 "2020-05-12T09:30:38Z")

</div>

Thanks Larry, I have chosen to change the Structure.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 9, 2020, 9:38am UTC](https://discuss.elastic.co/t/kibana-translate-filter-options/223930/6 "2020-06-09T09:38:01Z")

</div>

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