Non-prefix-based Completion Suggester in Elasticsearch -
i have mapping type follows:
{ "mappings": { "book": { "properties": { "title": { "type": "completion" } } } } }
and index data:
{"create": {"_index": "library", "_type": "book", "_id": 1}} {"id": 1, "title": "c++ how program"}
my question how document id 1 of type book if query this:
post /library/book/_search { "suggest": { "book-suggest": { "text": "program c++", "completion": { "field": "title" } } } }
Comments
Post a Comment