# Accented and non-accented characters in Elasticsearch

**URL:** <https://discuss.elastic.co/t/accented-and-non-accented-characters-in-elasticsearch/360703>\
**Category:** Elasticsearch\
**Created:** [June 3, 2024, 10:21am UTC](https://discuss.elastic.co/t/accented-and-non-accented-characters-in-elasticsearch/360703 "2024-06-03T10:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![navaneethan](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@navaneethan](https://discuss.elastic.co/u/navaneethan)\
**Post date:** [June 3, 2024, 10:21am UTC](https://discuss.elastic.co/t/accented-and-non-accented-characters-in-elasticsearch/360703/1 "2024-06-03T10:21:51Z")

</div>

Hi Team,

We need to produce both accented & non-accented characters for the non-accented searches in elasticsearch  
EX:  
for Amelie, the search should show Amelie as well as Amélie, Amèlie, Amélié, Ámelié, Àmelie

To reproduce this we have added the custom analyser as below

```auto
{
  "analysis" : {
    "analyzer":{          
         "accents_analyzer": {
         "tokenizer": "standard",
         "filter": ["lowercase", "asciifolding"]
       }          
    }
  }
}

```

This analyser is working for us, but we need to do

1. close & open the index
2. re-index with the new index creation

as both are involving the downtime,  
is there any other possibility to do this without downtime

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 3, 2024, 10:46am UTC](https://discuss.elastic.co/t/accented-and-non-accented-characters-in-elasticsearch/360703/2 "2024-06-03T10:46:09Z")

</div>

You can use an alias, reindex to the new index and switch the alias.

---

<div class="post-metadata">

**Author:** ![navaneethan](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@navaneethan](https://discuss.elastic.co/u/navaneethan)\
**Post date:** [June 3, 2024, 10:49am UTC](https://discuss.elastic.co/t/accented-and-non-accented-characters-in-elasticsearch/360703/3 "2024-06-03T10:49:09Z")

</div>

we are using this index in our production, re-indexing will cause downtime right ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 3, 2024, 3:52pm UTC](https://discuss.elastic.co/t/accented-and-non-accented-characters-in-elasticsearch/360703/4 "2024-06-03T15:52:21Z")

</div>

Not if you have an [alias](https://www.elastic.co/guide/en/elasticsearch/reference/current/aliases.html) on top of your production index and are using this alias to query the data.

Let say you have an alias named `prod` which is directing the data to `prod-v1`.

So your app is calling:

```auto
POST /prod/_doc
{
  "foo": "bar"
}
GET /prod/_search

```

You can run a reindex operation on the new index named `prod-v2`:

```auto
PUT /prod-v2
{
  // Settings and mappings go there
}
POST _reindex
{
  "source": {
    "index": "prod-v1"
  },
  "dest": {
    "index": "prod-v2"
  }
}

```

Once done, switch the alias:

```auto
POST _aliases
{
  "actions": [
    {
      "remove": {
        "index": "prod-v1",
        "alias": "prod"
      }
    },
    {
      "add": {
        "index": "prod-v2",
        "alias": "prod"
      }
    }
  ]
}

```

Once done, you can still call:

```auto
POST /prod/_doc
{
  "foo": "bar"
}
GET /prod/_search

```

Remove the old index:

```auto
DELETE prod-v1

```
