Bug of Term Suggester


(le trung Trung) #1

Suggester wills return fail results if suggest mode is missing.

I have example:

#analyzer
index:
analysis:
analyzer:
vi_analyzer:
type: custom
tokenizer: whitespace
filter: [trim, lowercase, hunspell_vi]
filter:
hunspell_vi:
type: hunspell
locale: vi_VN

delete the index

curl -XDELETE localhost:9200/test

insert a document

curl -XPUT localhost:9200/test/test/1 -d '{
"title": "bong bay"
}'

curl -XPUT localhost:9200/test/test/2 -d '{
"title": "ba bong bong"
}'

curl -XPUT localhost:9200/test/test/3 -d '{
"title": "ba bong bay"
}'

Suggest

curl -XPOST 'localhost:9200/_suggest' -d '{
"_suggestion" : {
"text" : "ba",
"term" : {
"field" : "title",
"suggest_mode": "missing",
"sort" : "score",
"min_word_length" : 1
}
}
}'

Results

{"_shards":{"total":52,"successful":52,"failed":0},"_suggestion":
[{"text":"ba","offset":0,"length":2,"options":[{"text":"bay","score":0.5,"freq":1}]}]}

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f27233c6-bcd9-47b6-b54a-9e67661562a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2