I have my mapping type as follows:
{
"mappings": {
"book": {
"properties": {
"title": {
"type": "completion"
}
}
}
}
}
and index a data:
{"create": {"_index": "library", "_type": "book", "_id": 1}}
{"id": 1, "title": "C++ How to Program"}
my question is how do i get document with id 1 of type book if my query is like this:
POST /library/book/_search
{
"suggest": {
"book-suggest": {
"text": "program C++",
"completion": {
"field": "title"
}
}
}
}