# Select like

**URL:** <https://discuss.elastic.co/t/select-like/71176>\
**Category:** Elasticsearch\
**Created:** [January 11, 2017, 5:42am UTC](https://discuss.elastic.co/t/select-like/71176 "2017-01-11T05:42:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonpv1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonpv1/32/16266_2.png) [@sonpv1](https://discuss.elastic.co/u/sonpv1)\
**Post date:** [January 11, 2017, 5:42am UTC](https://discuss.elastic.co/t/select-like/71176/1 "2017-01-11T05:42:58Z")

</div>

Hi experts,

Please help me to have query and mapping which will be the same with:

SELECT \* FROM table WHERE column LIKE '%this is the text%'

I'm using wildcard but as you know about the performance is not good!

Thank you so much.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2017, 5:59am UTC](https://discuss.elastic.co/t/select-like/71176/2 "2017-01-11T05:59:19Z")

</div>

Why not using a match phrase query?

---

<div class="post-metadata">

**Author:** ![sonpv1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonpv1/32/16266_2.png) [@sonpv1](https://discuss.elastic.co/u/sonpv1)\
**Post date:** [January 11, 2017, 7:10am UTC](https://discuss.elastic.co/t/select-like/71176/3 "2017-01-11T07:10:25Z")

</div>

Thank you so much.  
But as i understand, match\_phrase is used to match exact value. It will be the same with equalsIgnoreCase.  
Regarding to my problem, I have text like that:

"Thankfully, most people never need to use the span queries directly, as the match\_phrase query is usually good enough."

And I would like to search with substring likes:  
"need to use the span queries directly"

I expect that i could have the result.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 13, 2017, 6:45am UTC](https://discuss.elastic.co/t/select-like/71176/4 "2017-01-13T06:45:00Z")

</div>

Match phrase will probably work with the example you sent IMO

---

<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:** [February 10, 2017, 6:45am UTC](https://discuss.elastic.co/t/select-like/71176/5 "2017-02-10T06:45:07Z")

</div>

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