aneesh
(Arcadix Infotech Pvt.Ltd)
February 1, 2018, 10:32am
1
Hi
I need search results with exact matching of word but it should be case insensitive.
"Abc","ABC","aBc" : all should come in result
but
"Abc Def", "ABC FG" : should not come (do not search for substring)
GET people/people/_search
{
"query": {
"bool": {
"must":[
{
"match": {
"city.keyword": "York"
}
}
]
}
}
}
Thanks
Aneesh L
val
(Val Crettaz)
February 1, 2018, 10:36am
2
You should try using match_phrase
instead on the city
field
GET people/people/_search
{
"query": {
"bool": {
"must":[
{
"match_phrase": {
"city": "York"
}
}
]
}
}
}
aneesh
(Arcadix Infotech Pvt.Ltd)
February 1, 2018, 10:43am
3
But its giving New York also
I need only whole word match
dadoonet
(David Pilato)
February 1, 2018, 10:45am
4
I'd use a lowercase based analyzer in that case.
aneesh
(Arcadix Infotech Pvt.Ltd)
February 1, 2018, 10:47am
5
You mean a settings/mapping change?
system
(system)
Closed
March 1, 2018, 2:49pm
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.