# Search for phrase, even with missing letter

**URL:** <https://discuss.elastic.co/t/search-for-phrase-even-with-missing-letter/45985>\
**Category:** Elasticsearch\
**Created:** [March 31, 2016, 6:40pm UTC](https://discuss.elastic.co/t/search-for-phrase-even-with-missing-letter/45985 "2016-03-31T18:40:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauricioklein](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@mauricioklein](https://discuss.elastic.co/u/mauricioklein)\
**Post date:** [March 31, 2016, 6:40pm UTC](https://discuss.elastic.co/t/search-for-phrase-even-with-missing-letter/45985/1 "2016-03-31T18:40:36Z")

</div>

Hello!

I've researched a lot about this, but can't figure out a way to do that.

I'm searching for a way to match a phrase, even if the words are not in correct order and if some letter is missing in a word (a typo, for example).

This query should be performed in all documents, so, GET \_http://localhost:9200/_search_ would be OK.

Some examples below:

Keyword: **Resaurant** (missing the first "t" letter)

Should match:

- _Restaurant_
- _Restaurante_
- _Chinese Restaurant_
- _The Restaurant of Tomorrow_

The most equivalent entries will have better scores, of course.

Does anyone know who can I write down this query?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)\
**Post date:** [March 31, 2016, 7:07pm UTC](https://discuss.elastic.co/t/search-for-phrase-even-with-missing-letter/45985/2 "2016-03-31T19:07:32Z")

</div>

I think you have two options:

- using wildcard search at the link below (or follow [Lucene Query Syntax](http://www.lucenetutorial.com/lucene-query-syntax.html))  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)
- using ngram or edge ngram tokenizer for the field that you want to search on (I think it's doable)  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html)

---

<div class="post-metadata">

**Author:** ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)\
**Post date:** [March 31, 2016, 7:11pm UTC](https://discuss.elastic.co/t/search-for-phrase-even-with-missing-letter/45985/3 "2016-03-31T19:11:06Z")

</div>

Just found this one... another option using shingle token filter or word-ngram

> **[Searching with Shingles
	  	 | Elastic](https://www.elastic.co/blog/searching-with-shingles)**
>
> In this article, I want to introduce Shingles. Shingles are effectively word-nGrams. Given a stream of tokens, the shingle filter will create new tokens by concatenating adjacent terms. For example, g...

[https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html)

---

<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 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/search-for-phrase-even-with-missing-letter/45985/4 "2017-07-05T23:03:30Z")

</div>


