# Elasticsearch Query: Returning results with Diacritics (Accents and special characters)

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746>\
**Category:** Elasticsearch\
**Created:** [June 8, 2017, 5:17pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746 "2017-06-08T17:17:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gl1398](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@gl1398](https://discuss.elastic.co/u/gl1398)\
**Post date:** [June 8, 2017, 5:17pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746/1 "2017-06-08T17:17:53Z")

</div>

Hi All,

Im pretty new to elasticsearch so bare with me.

Im trying to return results for names with Diacritics (example: é at the end of the name). I want to be able to search using regular characters and receive all results, including names with diacritics (Example: want to search for Beyonce and return all results with Beyoncé).

I am using Insomnia Step API to run the elasticserach query. Post method and JSON

After doing research I added the following code to the end of my query.....

"settings" : {  
"analysis" : {  
"analyzer" : {  
"default" : {  
"tokenizer" : "standard",  
"filter" : ["standard", "my\_ascii\_folding"]  
}  
},  
"filter" : {  
"my\_ascii\_folding" : {  
"type" : "asciifolding",  
"preserve\_original" : true  
}  
}  
}  
}  
}

Im still not getting any results from added that to my query. What am I missing?

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [June 8, 2017, 9:13pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746/2 "2017-06-08T21:13:53Z")

</div>

> [@gl1398](#):
>
> Im still not getting any results from added that to my query. What am I missing?

You don't need to add that to your query, you can instead set it on the field:

Here's an example:

```
PUT /test
{
  "settings" : {
    "analysis" : {
      "analyzer" : {
        "my-asciifolding" : {
          "tokenizer" : "standard",
          "filter" : ["standard", "lowercase", "asciifolding"]
        }
      }
    }
  },
  "mappings": {
    "doc": {
      "properties": {
        "person": {
          "type": "text",
          "analyzer": "my-asciifolding"
        }
      }
    }
  }
}

POST /test/doc/1
{ "person": "Beyoncé" }

POST /test/_analyze
{
  "field": "person",
  "text": "Beyoncé"
}

POST /test/_search
{
  "query": {
    "match": {
      "person": "beyonce"
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![gl1398](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@gl1398](https://discuss.elastic.co/u/gl1398)\
**Post date:** [June 8, 2017, 9:41pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746/3 "2017-06-08T21:41:31Z")

</div>

what do you mean by set it on the field?

This is my current query with the previous piece removed.

![](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b6cf4897bb52bf3d521f7e2d3ba2afe2b75cc1e5.png)

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [June 8, 2017, 9:44pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746/4 "2017-06-08T21:44:42Z")

</div>

What are the mappings and settings for your index? (`GET /<index>`)

---

<div class="post-metadata">

**Author:** ![gl1398](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@gl1398](https://discuss.elastic.co/u/gl1398)\
**Post date:** [June 9, 2017, 1:11pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746/5 "2017-06-09T13:11:26Z")

</div>

I dont believe I have access to the index. Is there anyway to update the query without updating the index?

If and when I get access to the index what code should be added?

---

<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:** [July 7, 2017, 1:12pm UTC](https://discuss.elastic.co/t/elasticsearch-query-returning-results-with-diacritics-accents-and-special-characters/88746/6 "2017-07-07T13:12:22Z")

</div>

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