Here i have created a gist example.
I have created a indices with a single field named "message". In that
indices, I have 10 documents with same message string, while searching
on this indices i am getting different score values for resulting
documents.
Gist Example Here......
curl -XPUT 'http://192.168.0.141:9200/dbtest123'
curl -XPUT 'http://192.168.0.141:9200/dbtest123/meta/_mapping' -d
'{"datatable" : { "properties" : { "message" : {"type" : "string",
"store" : "yes"} } } }'
curl -XPUT 'http://192.168.0.141:9200/dbtest123/meta/1' -d
'{"message" :"trying out Elastic Search It takes the snapshot while
working on group of documents, Based on the snapshot, it will do
update process or other task"}'
curl -XPUT 'http://192.168.0.141:9200/dbtest123/meta/2' -d
'{"message" : "trying out Elastic Search It takes the snapshot while
working on group of documents, Based on the snapshot, it will do
update process or other task"}'
curl -XPUT 'http://192.168.0.141:9200/dbtest123/meta/3' -d
'{"message" :"trying out Elastic Search It takes the snapshot while
working on group of documents, Based on the snapshot, it will do
update process or other task" }'
....
....
....
up to 10 documents....
curl -XGET 'http://192.168.0.141:9200/dbtest123/meta/_search' -d
'{"query":{"term" : { "message" : "search" }}}'
{"took":0,"timed_out":false,"_shards":{"total":5,"successful":
5,"failed":0},"hits":{"total":10,"max_score":0.15581955,"hits":
[{"_index":"db123","_type":"meta","_id":"3","_score":0.15581955,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}},
{"_index":"db123","_type":"meta","_id":"8","_score":0.15581955,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}},
{"_index":"db123","_type":"meta","_id":"10","_score":0.15581955,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}},{"_index":"db123","_type":"
meta","_id":"4","_score":0.13005449, "_source" : { "message" : "trying
out Elastic Search It takes the snapshot while working on group of
documents, Based on the snapshot, it will do update process or other
task"}},{"_index":"db123","_type":"meta","_id":"9","_score":
0.13005449, "_source" : { "message" : "trying out Elastic Search It
takes the snapshot while working on group of documents, Based on the
snapshot, it will do update process or other task"}},
{"_index":"db123","_type":"meta","_id":"1","_score":0.13005449,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}},
{"_index":"db123","_type":"meta","_id":"6","_score":0.13005449,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}},
{"_index":"db123","_type":"meta","_id":"2","_score":0.13005449,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}},
{"_index":"db123","_type":"meta","_id":"7","_score":0.13005449,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}},
{"_index":"db123","_type":"meta","_id":"5","_score":0.067124054,
"_source" : { "message" : "trying out Elastic Search It takes the
snapshot while working on group of documents, Based on the snapshot,
it will do update process or other task"}}]}}.
Questions:
-
Why does the score varying for same content?
-
How does the score value calculated in Elastic Search...?
-
If i have a Boolean query for multiple field, Can we mention a
specific field for score calculation for full query....?