Select like


(Son Phan) #1

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.


(David Pilato) #2

Why not using a match phrase query?


(Son Phan) #3

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.


(David Pilato) #4

Match phrase will probably work with the example you sent IMO


(system) #5

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