# Elasticsearch query "Like" SQL

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-like-sql/32463>\
**Category:** Elasticsearch\
**Created:** [October 19, 2015, 9:30am UTC](https://discuss.elastic.co/t/elasticsearch-query-like-sql/32463 "2015-10-19T09:30:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barakucrut](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Barakucrut](https://discuss.elastic.co/u/Barakucrut)\
**Post date:** [October 19, 2015, 9:30am UTC](https://discuss.elastic.co/t/elasticsearch-query-like-sql/32463/1 "2015-10-19T09:30:58Z")

</div>

Hello everybody ,

i'm newbie in elastisearch ,  
I want to make autocomplete feature on my site ,  
How to make query like this on elasticsearch engine "SELECT \* FROM Gadget where title like '%asus zenfone 2 ZE%'  
I have tried several way to get the relevance result , but until this time i got result but not relevant data ,  
when i search with keyword "red" i don't find "Xiaomi Redmi" on my search result , i must set "redmi" on my keyword

this is my analyze setting

"settings": {  
"analysis": {  
"filter": {  
"nGram\_filter": {  
"type": "nGram",  
"min\_gram": 2,  
"max\_gram": 20,  
"token\_chars": [  
"letter",  
"digit",  
"punctuation",  
"symbol"  
]  
}  
},  
"analyzer": {  
"nGram\_analyzer": {  
"type": "custom",  
"tokenizer": "whitespace",  
"filter": [  
"lowercase",  
"asciifolding",  
"nGram\_filter"  
]  
},  
"whitespace\_analyzer": {  
"type": "custom",  
"tokenizer": "whitespace",  
"filter": [  
"lowercase",  
"asciifolding"  
]  
}  
}  
}

So many thanks for your enlightenment friend 😄

---

<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:44pm UTC](https://discuss.elastic.co/t/elasticsearch-query-like-sql/32463/2 "2017-07-05T23:44:06Z")

</div>


