aaaghh
defagee
ccacc
aaa agh
ddgdd
rarrgrr
bbbaghjj
I have these values in Name column. I need to get only strings contains "ag". How can I implement it in elasticsearch?
GET /student/_search
{
"from": 0,
"size": 1000,
"query": {
"bool": {
"must": [
{
"match_phrase_prefix": {
"Name": "*ag*"
}
}
]
}
}
}
The query is giving only "aaa agh" as result. I think match prefix will return only those strings starts with pattern(words). Is there any other query?