Hi All,
I have problem with AutoCompletion Suggester.
When I index same word in record, AutoCompletion will return duplicate that 
record,
Here is restful:

curl -X PUT 10.30.58.105:9200/completion 
curl -X DELETE 10.30.58.105:9200/completion/song
curl -X PUT 10.30.58.105:9200/completion/song/_mapping -d '{
  "song" : {
        "properties" : {            
            "song-suggest" : { "type" : "completion",
                          "index_analyzer" : "simple",
                          "search_analyzer" : "simple",
                          "payloads" : true
            }
        }
    }
}'
//insert duplicate word "Nothing"
curl -X PUT '10.30.58.105:9200/completion/song/1?refresh=true' -d 
'{"song-suggest":{"input":["Nothing Nothing Else Matter","Nothing Else 
Matter","Else Matter","Matter"],"payload":{"name":"Nothing Else Matter - 
Metallica 1"},"weight":12}}'

curl -X POST '10.30.58.105:9200/completion/_suggest?pretty' -d '{
    "song-suggest" : {
        "text" : "Nothing",
        "completion" : {
            "field" : "song-suggest"
        }
    }
}'

The return value will:

{
  "_shards" : {
    "total" : 2,
    "successful" : 2,
    "failed" : 0
  },
  "song-suggest" : [ {
    "text" : "Nothing",
    "offset" : 0,
    "length" : 7,
    "options" : [ {
      "text" : "Nothing Else Matter",
      "score" : 1.0, "payload" : {"name":"Nothing Else Matter - Metallica 
1"}
    }, {
      "text" : "Nothing Nothing Else Matter",
      "score" : 1.0, "payload" : {"name":"Nothing Else Matter - Metallica 
1"}
    } ]
  } ]
}

Although I only have one record.

Thanks.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/e3c1d118-7b2f-4e03-a682-f901124c287a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to