# Pokémon - match\_phrase fails with edge\_ngram & asciifolding

**URL:** <https://discuss.elastic.co/t/pokemon-match-phrase-fails-with-edge-ngram-asciifolding/300901>\
**Category:** Elasticsearch\
**Created:** [March 29, 2022, 1:40am UTC](https://discuss.elastic.co/t/pokemon-match-phrase-fails-with-edge-ngram-asciifolding/300901 "2022-03-29T01:40:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![omikron](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@omikron](https://discuss.elastic.co/u/omikron)\
**Post date:** [March 29, 2022, 1:40am UTC](https://discuss.elastic.co/t/pokemon-match-phrase-fails-with-edge-ngram-asciifolding/300901/1 "2022-03-29T01:40:34Z")

</div>

Hi,

I am having an issue with the `match_phrase` query against the field with the edge\_ngram tokenizer and asciifolding filter (Elasticsearch v7.7).

The field is:

```auto
"mainTitle": {
	"type": "text",
	"fields": {
		"autocomplete": {
			"type": "text",
			"analyzer": "custom_lowercase"
		}
...
"analyzer": {
	"custom_lowercase": {
		"filter": [
			"lowercase",
			"asciifolding"
		],
		"type": "custom",
		"tokenizer": "autocomplete"
	}
},
"tokenizer": {
	"autocomplete": {
		"token_chars": [
			"letter",
			"digit"
		],
		"min_gram": "2",
		"type": "edge_ngram",
		"max_gram": "10"
	}
}

```

`_analyze` with

```auto
{
  "tokenizer" : "autocomplete",
  "filter" : ["lowercase", "asciifolding"],
  "text" : "Pokémon"
}

```

generates correct tokens I believe:

```auto
{
    "tokens": [
        {
            "token": "po",
            "start_offset": 0,
            "end_offset": 2,
            "type": "word",
            "position": 0
        },
        {
            "token": "pok",
            "start_offset": 0,
            "end_offset": 3,
            "type": "word",
            "position": 1
        },
        {
            "token": "poke",
            "start_offset": 0,
            "end_offset": 4,
            "type": "word",
            "position": 2
        },
        {
            "token": "pokem",
            "start_offset": 0,
            "end_offset": 5,
            "type": "word",
            "position": 3
        },
        {
            "token": "pokemo",
            "start_offset": 0,
            "end_offset": 6,
            "type": "word",
            "position": 4
        },
        {
            "token": "pokemon",
            "start_offset": 0,
            "end_offset": 7,
            "type": "word",
            "position": 5
        }
    ]
}

```

However, when I perform the query:

```auto
{
	"match_phrase": {
		"mainTitle.autocomplete": {
			"query": "poké"
		}
	}
}

```

I don't get a document with `Pokémon` title. Actually, no matter if I search for `poké` or `poke`, the document is not returned, but if I search for `pok` it is returned.

Please advice, thank you.

---

<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:** [April 26, 2022, 1:40am UTC](https://discuss.elastic.co/t/pokemon-match-phrase-fails-with-edge-ngram-asciifolding/300901/2 "2022-04-26T01:40:57Z")

</div>

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