Nik, David,
Thanks for the reply. I was trying to debug the behaviour further. For the same request, response from curl is different from Java client. The scores are also different. The requests and responses for Java client and Curl are as follows. The java client versions 1.3.2 and 1.3.1 has the same response as the curl response. Trying to understand why are they different.
Java Client Request:
{
"bool" : {
"should" : [ {
"match" : {
"name" : {
"query" : "name",
"type" : "boolean"
}
}
}, {
"match" : {
"name" : {
"query" : "INDIVIDUAL",
"type" : "boolean"
}
}
} ]
}
}
Java Client Response:
{
"took":38590,
"timed_out":false,
"_shards":{
"total":5,
"successful":5,
"failed":0
},
"hits":{
"total":3,
"max_score":0.11447419,
"hits":[
{
"_index":"default-index",
"_type":"com-thomsonreuters-grc-platform-util-searching-elasticsearch-DummyObject",
"_id":"third",
"_score":0.11447419,
"_source":{
"id":"third",
"name":"IndIVIDUAL",
"version":0,
"creationDateInMillis":0
}
},
{
"_index":"default-index",
"_type":"com-thomsonreuters-grc-platform-util-searching-elasticsearch-DummyObject",
"_id":"first",
"_score":0.11447419,
"_source":{
"id":"first",
"name":"INDIVIDUAL",
"version":0,
"creationDateInMillis":0
}
},
{
"_index":"default-index",
"_type":"com-thomsonreuters-grc-platform-util-searching-elasticsearch-DummyObject",
"_id":"second",
"_score":0.11447419,
"_source":{
"id":"second",
"name":"individual",
"version":0,
"creationDateInMillis":0
}
}
]
}
}
So I tried to create a same request from curl
Curl Request
curl -XGET http://localhost:9200/default-index/_search -d '{"query":{"bool":{"should":[{"match":{"name":{"query":"name","type":"boolean"}}},{"match":{"name":{"query":"INDIVIDUAL","type":"boolean"}}}]}}}'
Curl Response
{
"took":70,
"timed_out":false,
"_shards":{
"total":5,
"successful":5,
"failed":0
},
"hits":{
"total":3,
"max_score":0.09848769,
"hits":[
{
"_index":"default-index",
"_type":"com-thomsonreuters-grc-platform-util-searching-elasticsearch-DummyObject",
"_id":"first",
"_score":0.09848769,
"_source":{
"id":"first",
"name":"INDIVIDUAL",
"version":0,
"creationDateInMillis":0
}
},
{
"_index":"default-index",
"_type":"com-thomsonreuters-grc-platform-util-searching-elasticsearch-DummyObject",
"_id":"second",
"_score":0.09848769,
"_source":{
"id":"second",
"name":"individual",
"version":0,
"creationDateInMillis":0
}
},
{
"_index":"default-index",
"_type":"com-thomsonreuters-grc-platform-util-searching-elasticsearch-DummyObject",
"_id":"third",
"_score":0.04500804,
"_source":{
"id":"third",
"name":"IndIVIDUAL",
"version":0,
"creationDateInMillis":0
}
}
]
}
}