Hi,
I am trying use highlighter api in my application, it works fine but if my query string ends '0' then i have some issues.
E.g:
POST /user-x187/_search?from=0&size=10
{
"_source" : ["policyNumer",
"userId", "companyId", "dateOfJoining", "phoneNumber"],
"sort": [
{
"dateOfJoining": {
"order": "desc"
}
}
],
"query": {
"multi_match": {
"query": "2345678910",
"fields": [
"policyNumer.raw",
"policyNumer",
"userId",
"companyId",
"phoneNumber"
],
"minimum_should_match":"100"
}
},
"highlight" : {
"require_field_match": true,
"fields" : {
"userId" : {},
"policyNumer":{},
"policyNumer.raw":{},
"companyId":{},
"phoneNumber":{}
}
}
}
Result:
{
"took": 6,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 6,
"max_score": null,
"hits": [
{
"_index": "user-x187",
"_type": "user",
"_id": "SEARCH00027",
"_score": null,
"_source": {
"userId": "SEARCH00027",
"companyId": "x187",
"phoneNumber" : "2345678910",
"policyNumer":"23456789123456",
"dateOfJoining" :"07/27/2014, 12:00:00 AM -0400"
},
"highlight": {
"phoneNumber": [
"<em>2345678910</em>"
],
"policyNumer": [
"<em>234567891</em>23456"
]
},
"sort": [
"07/27/2014, 12:00:00 AM -0400"
]
}
]
}
}
My query string is "2345678910" but it highlighted "policyNumber" which is 234567891. Any idea why it showing partial field even i put require_field_match is true.
Thanks
Pranesh