# LIKE in Sql Server I'm Using Prefix query in elasticsearch but i have an issue?

**URL:** <https://discuss.elastic.co/t/like-in-sql-server-im-using-prefix-query-in-elasticsearch-but-i-have-an-issue/192182>\
**Category:** Elasticsearch\
**Created:** [July 25, 2019, 6:55am UTC](https://discuss.elastic.co/t/like-in-sql-server-im-using-prefix-query-in-elasticsearch-but-i-have-an-issue/192182 "2019-07-25T06:55:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [July 25, 2019, 6:55am UTC](https://discuss.elastic.co/t/like-in-sql-server-im-using-prefix-query-in-elasticsearch-but-i-have-an-issue/192182/1 "2019-07-25T06:55:54Z")

</div>

Let's say if I search ".5t" I need to get the corresponding document that matches the string that I showed...But I'm getting zero results.

Here is the query  
`GET indexname/indextype/_search`  
{  
"\_source": ["code"],  
"query": {  
"bool": {  
"must": [  
{  
"prefix": {  
"code": {  
"value": ".5t"  
}  
}  
}  
]  
}  
}  
}

Thanks

---

<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:** [August 22, 2019, 6:55am UTC](https://discuss.elastic.co/t/like-in-sql-server-im-using-prefix-query-in-elasticsearch-but-i-have-an-issue/192182/2 "2019-08-22T06:55:55Z")

</div>

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