我正在使用弹性搜索来创建某种标签引擎。我正在插入文档,无法检索它。我复制问题的步骤:
PUT index
{
"mappings": {
"taggeable" : {
"_all" : {"enabled" : false},
"properties" : {
"id" : {
"type" : "string",
"index" : "no"
},
"tags" : {
"type" : "text"
}
}
}
}
}
2) 插入文档:
POST index/taggeable
{
"id" : "1",
"tags" : "tag1 tag2"
}
3) 使用类似以下内容的查询:
GET index/_search
{
"query": {
"more_like_this" : {
"fields" : ["tags"],
"like" : ["tag1"],
"min_term_freq" : 1
}
}
}
但我收到:
{
"_shards": {
"failed": 0,
"skipped": 0,
"successful": 5,
"total": 5
},
"hits": {
"hits": [],
"max_score": null,
"total": 0
},
"timed_out": false,
"took": 1
}
有人知道我做错了什么吗?我应该检索我插入的文档。