Hi Team,
I have some problem when I am doing filtering with term.
Say for Example I have a field in my index called "customer_id" the value is : LC/2089011
When I give to search for some other customer id like
bool:{
"filter":[{
"term":{
"customer_id":"2089011"
}
}]
}
By the above case It found the record which contains LC/2089011. Where I do not want this. Can any one help me?
Igor_Motov
(Igor Motov)
November 17, 2017, 11:06pm
2
If you used default mapping and elasticsearch v5.x or above the following query might solve your problem
bool:{
"filter":[{
"term":{
"customer_id.keyword":"2089011"
}
}]
}
If this doesn't work, please provide the mapping for the field customer_id
.
3 Likes
xavierfacq
(Xavier Facq)
November 18, 2017, 6:38pm
3
hi,
Else you'll need to change your field mapping (customer_id) to not analyzed.
system
(system)
Closed
December 16, 2017, 6:38pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.