# Fuzzy Query With Wildcard

**URL:** <https://discuss.elastic.co/t/fuzzy-query-with-wildcard/32598>\
**Category:** Elasticsearch\
**Created:** [October 20, 2015, 5:36pm UTC](https://discuss.elastic.co/t/fuzzy-query-with-wildcard/32598 "2015-10-20T17:36:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaldiscool](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@ronaldiscool](https://discuss.elastic.co/u/ronaldiscool)\
**Post date:** [October 20, 2015, 5:36pm UTC](https://discuss.elastic.co/t/fuzzy-query-with-wildcard/32598/1 "2015-10-20T17:36:05Z")

</div>

Is there a way to do a fuzzy search with a wildcard token as well. So for example, if I searched \*lap, anything can map to \* without any penalty and then I still have one more edit that I can use on the rest of the word.

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [October 20, 2015, 10:25pm UTC](https://discuss.elastic.co/t/fuzzy-query-with-wildcard/32598/2 "2015-10-20T22:25:44Z")

</div>

There is no query for this. However, you could use an index-time solution to this problem that would consist in populating a field with only the last 3 chars of every token (using edge n-grams) and then run a fuzzy query on this field.

---

<div class="post-metadata">

**Author:** ![ronaldiscool](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@ronaldiscool](https://discuss.elastic.co/u/ronaldiscool)\
**Post date:** [October 31, 2015, 6:43am UTC](https://discuss.elastic.co/t/fuzzy-query-with-wildcard/32598/3 "2015-10-31T06:43:49Z")

</div>

How do you use an edgeNGram tokenizer for a suffix query? Currently when I try to build my index, the following query does not yield anything:

curl -XPUT 'localhost:9200/freqreverse' -d '  
{  
"settings": {  
"number\_of\_shards": 1,  
"analysis": {  
"tokenizer": {  
"ngram\_tokenizer": {  
"type": "edgeNGram",  
"min\_gram": 3,  
"max\_gram": 20  
}  
},  
"analyzer": {  
"ngram\_tokenizer\_analyzer": {  
"type": "custom",  
"tokenizer": "ngram\_tokenizer", "filter":["reverse","edgeNGram", "reverse"] } } } },  
"mappings": {  
"freq": {  
"properties": {  
"word\_name": {  
"type": "string",  
"term\_vector": "yes",  
"analyzer": "ngram\_tokenizer\_analyzer" } } } }}'

---

<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:41pm UTC](https://discuss.elastic.co/t/fuzzy-query-with-wildcard/32598/4 "2017-07-05T23:41:34Z")

</div>


