# Search for words with accents with the Java API

**URL:** <https://discuss.elastic.co/t/search-for-words-with-accents-with-the-java-api/212343>\
**Category:** Elasticsearch\
**Created:** [December 18, 2019, 2:12pm UTC](https://discuss.elastic.co/t/search-for-words-with-accents-with-the-java-api/212343 "2019-12-18T14:12:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlonfa](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@marlonfa](https://discuss.elastic.co/u/marlonfa)\
**Post date:** [December 18, 2019, 2:12pm UTC](https://discuss.elastic.co/t/search-for-words-with-accents-with-the-java-api/212343/1 "2019-12-18T14:12:22Z")

</div>

Hi guys  
I am using Java API Elasticsearch 7.4 and would like to know how to do in Java to search for texts with accents, for example:

**"João de Souza Antonio"**

But to no avail. I've tried using Term, Match, Wildcard, but none worked. Reading more about the documentation I saw the option to use filters like:

```
"index" : {
    "analysis" : {
        "analyzer" : {
            "default" : {
                "tokenizer" : "standard",
                "filter" : ["standard", "my_ascii_folding"]
            }
        },
        "filter" : {
            "my_ascii_folding" : {
                "type" : "asciifolding",
                "preserve_original" : true
            }
        }
    }
}

```

But how would you do it in Java?

Thank you

---

<div class="post-metadata">

**Author:** ![Magnus\_Kessler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnus_kessler/32/42001_2.png) [@Magnus\_Kessler](https://discuss.elastic.co/u/Magnus_Kessler)\
**Post date:** [December 18, 2019, 2:22pm UTC](https://discuss.elastic.co/t/search-for-words-with-accents-with-the-java-api/212343/2 "2019-12-18T14:22:46Z")

</div>

Hi Marlon,

You'd typically set up the analysis via [index templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html). Then at indexing time the defined analysers will be used to create the correct indexed tokens, and at search time the same analyser is used on the search input.

The Java API supports [index template](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-put-template.html), too.

---

<div class="post-metadata">

**Author:** ![marlonfa](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@marlonfa](https://discuss.elastic.co/u/marlonfa)\
**Post date:** [December 19, 2019, 10:54am UTC](https://discuss.elastic.co/t/search-for-words-with-accents-with-the-java-api/212343/3 "2019-12-19T10:54:43Z")

</div>

Thanks for the help, that's what you needed.

---

<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:** [January 16, 2020, 10:54am UTC](https://discuss.elastic.co/t/search-for-words-with-accents-with-the-java-api/212343/4 "2020-01-16T10:54:53Z")

</div>

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