Lucene will calculate you score based on a scoring formula. I am pretty sure that the location of the word is not part of this formula but rather how common the word is in your sentence. I.e multiple occurences of 'venue' should increase scoring and adding other words to your sentence should decrease the scoring.
Hope this helps, I am pretty sure there is detailed info about this in the lucene docs. Kind regards /Johan Den onsdagen den 22:e januari 2014 kl. 13:10:00 UTC+1 skrev Nikolay Chankov: > > I am playing with elasticsearch so far, and i noticed something: > > If I search for a word in a string, the _score is equal no matter where is > placed the word. Here I have prepared a test case: > > curl -XDELETE 'http://localhost:9200/test_search' > curl -XPUT 'http://localhost:9200/test_search/' -d ' > { > "mappings" : { > "test_record" : { > "properties" : { > "name" : { > "type" : "string" > } > } > } > } > }' > > curl -XPUT 'http://localhost:9200/test_search/test_record/1' -d '{ > "name" : "is the name Venue of that one" > }' > > curl -XPUT 'http://localhost:9200/test_search/test_record/2' -d '{ > "name" : "is the name of that one Venue" > }' > > curl -XPUT 'http://localhost:9200/test_search/test_record/3' -d '{ > "name" : "Venue is the name of that one" > }' > > curl -XGET 'http://localhost:9200/test_search/_search' -d '{ > "query": { > "bool": { > "must": [ ], > "must_not": [ ], > "should": [ > { > "query_string" : { > "default_field": "_all", > "query" : "venue" > } > } > ] > } > }, > "from": 0, > "size": 10 > }' > > The question is: how to have different score based on the position of the > word 'venue' in the test. When I search I would expect results to be > ordered 3,1,2 while now they are as they are inserted ,1,2,3. > > Any hint will be much appreciated > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2e9ae53d-0bb3-4d56-93b2-f62c95fe93fb%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.