elasticsearch - Elastic search score discrepancy -


i have single record in elastic search cluster. has text "foo bar".

when run following query on cluster, score comes out 0.11506979 :

{   "size" : 100,   "query" : {         "query_string" : {           "query" : "foo bar"         }       }   } 

however, when run following query (notice * after foo bar) on cluster, score comes out 0.9798734

{   "size" : 100,   "query" : {         "query_string" : {           "query" : "foo bar*"         }       }  } 

why score more in case add * ? isn't there 1 document match?

why score more in case add * ?

the above * matches documents have fields matching wildcard expression (not analyzed). matches character sequence (including empty one)

isn't there 1 document match?

it depends on index analyzer, how indexing fields in given document. if using default analyzer es use standard analyzer. check how indexed data getting stored internally in es go through this.

also, regarding actual score should aware of internal mechanism used es scoring docs. this getting better idea of scoring mechanism.

in case of doubts feel free ask further questions.

thanks


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -