# Does search\_as\_you\_type and completion work with accent?

**URL:** <https://forum.opensearch.org/t/does-search-as-you-type-and-completion-work-with-accent/16968>\
**Category:** OpenSearch\
**Created:** [December 6, 2023, 9:37am UTC](https://forum.opensearch.org/t/does-search-as-you-type-and-completion-work-with-accent/16968 "2023-12-06T09:37:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yathus](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@Yathus](https://forum.opensearch.org/u/Yathus)\
**Post date:** [December 6, 2023, 9:37am UTC](https://forum.opensearch.org/t/does-search-as-you-type-and-completion-work-with-accent/16968/1 "2023-12-06T09:37:02Z")

</div>

Hello,

I’m following this documentation : [Autocomplete - OpenSearch documentation](https://opensearch.org/docs/latest/search-plugins/searching-data/autocomplete/)

i’m unable to use search\_as\_you\_type or completion with french title and accent like “é”.

For example “ecureuil”, “Ecureuil” and “écureuil” are 3 differents words for suggest / autocomplete and i don’t have the same result.

But with a french\_standard analyser and a match\_phrase\_prefix request, it’s working, theses 3 words “ecureuil”, “Ecureuil” and “écureuil” are the same and i have all the results i need.

My mapping index :

```auto
 "analyzer": {
        "french_standard": {
          "tokenizer": "standard",
          "filter": ["lowercase", "asciifolding", "french_synonyms", "french_stop"]
        },
[...]
"title_fre": {
        "type": "text",
        "analyzer": "french_standard",
        "fields": {
          "suggest": {
            "type": "search_as_you_type"
          },
          "completion": {
            "type": "completion"
          },
          "keyword": { 
            "type": "keyword"
          }
        }
      },

```

Did i miss something ?

Thanks

---

<div class="post-metadata">

**Author:** ![radu.gheorghe](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/radu.gheorghe/32/3516_2.png) [@radu.gheorghe](https://forum.opensearch.org/u/radu.gheorghe)\
**Post date:** [December 8, 2023, 7:46am UTC](https://forum.opensearch.org/t/does-search-as-you-type-and-completion-work-with-accent/16968/2 "2023-12-08T07:46:32Z")

</div>

Your `title_fre.sugest` field is effectively a different field than your `title_fre`, it’s just that you get a `copy_to` for free. So you’ll have to specifically put your `french_standard` analyzer under `suggest`, too.

I think (and hope 😊 ) this will fix it.

---

<div class="post-metadata">

**Author:** ![Yathus](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@Yathus](https://forum.opensearch.org/u/Yathus)\
**Post date:** [December 8, 2023, 8:32am UTC](https://forum.opensearch.org/t/does-search-as-you-type-and-completion-work-with-accent/16968/3 "2023-12-08T08:32:51Z")

</div>

I tried this :

```auto

{
  "suggest": {
    "product-suggestions": {
      "prefix": "ecur",
      "completion": {
        "field": "title_fre.completion",
        "analyzer": "french_standard"
      }
    }

```

or

```auto
{
  "suggest": {
    "product-suggestions": {
      "prefix": "écur",
      "completion": {
        "field": "title_fre.completion",
        "analyzer": "french_standard"
      }
    }

```

and i don’t have suggestions wtih accent in seconde case.

so i try

```auto
{
  "query": {
    "multi_match": {
      "query": "ecur",
      "type": "bool_prefix",
      "fields": [
        "title_fre.suggest",
        "title_fre.suggest._2gram",
        "title_fre.suggest._3gram"
      ],
      "analyzer": "french_standard"
    }
  }
}

```

with écur or ecur and this one is not working, i can’t get results with é or e in first position of word “écureuil”

If i change analyzer to search\_analyzer i have an error : `"[multi_match] query does not support [search_analyzer]"`

---

<div class="post-metadata">

**Author:** ![radu.gheorghe](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/radu.gheorghe/32/3516_2.png) [@radu.gheorghe](https://forum.opensearch.org/u/radu.gheorghe)\
**Post date:** [December 8, 2023, 9:22am UTC](https://forum.opensearch.org/t/does-search-as-you-type-and-completion-work-with-accent/16968/4 "2023-12-08T09:22:09Z")

</div>

Ah, sorry, I meant that you have to put the analyzer in the mapping. Which requires you to re-create the index and re-index the data. This way, your `suggest` field will be analyzed how you intend.

The query will, by default, pick up that analyzer. You’ll specify a different analyzer at query time only if you need a different analyzer than the default.

But with the original mapping, you’re efectively using the standard analyzer for the `suggest` subfield, it doesn’t pick it up from the `title_fre` parent.
