Closed vamshin closed 4 years ago
Manually verified suggest Field to check PostingsFormat fix
curl -X PUT "localhost:9200/music?pretty" -H 'Content-Type: application/json' -d'
{ "settings": { "index": { "knn": true } }, "mappings": { "properties": { "suggest": { "type": "completion" } } } } '
curl -X POST "localhost:9200/music/_doc/1?refresh=true" -H 'Content-Type: application/json' -d' { "suggest" : { "input": [ "Nevermind", "Nirvana" ], "weight" : 34 } } '
curl -X POST "localhost:9200/music/_search?pretty" -H 'Content-Type: application/json' -d' { "suggest": { "song-suggest": { "prefix": "nir", "completion": { "field": "suggest" } } } } '
Output:-
{ "took" : 92, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 0, "relation" : "eq" }, "max_score" : null, "hits" : [ ] }, "suggest" : { "song-suggest" : [ { "text" : "nir", "offset" : 0, "length" : 3, "options" : [ { "text" : "Nirvana", "_index" : "music", "_type" : "_doc", "_id" : "1", "_score" : 34.0, "_source" : { "suggest" : { "input" : [ "Nevermind", "Nirvana" ], "weight" : 34 } } } ] } ] } }
Issue #, if available: https://github.com/opendistro-for-elasticsearch/k-NN/issues/227
Description of changes: https://github.com/opendistro-for-elasticsearch/k-NN/pull/236
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.