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/c69d8a86-f991-4f00-a315-ff56fc075bee%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to