【发布时间】:2019-02-20 13:52:56
【问题描述】:
我正在尝试将自动完成功能添加到我在弹性搜索中创建的嵌套对象中。
我设置的映射设置:
"mappings": {
"doc": {
"object": {
"type": "nested",
"properties": {
"author": {
"type": "text",
"analyzer": "hebrew"
},
"content": {
"type": "text",
"analyzer": "hebrew"
},
"title": {
"type": "text",
"analyzer": "hebrew"
},
"suggest" : { "type": "completion"}
}
}
}
}
我使用的是嵌套对象,因为我还使用 fscrawler 将 json 文档添加到索引中。
我使用以下查询:
{
"suggest": {
"suggester" : {
"prefix" : "test",
"completion" : {
"field" : "object.suggest"
}
}
}
}
但问题是,无论我输入什么,我都没有得到任何结果。
我是否正确设置了映射?还是查询错误?
【问题讨论】:
-
您解决了这个问题吗?如果是意味着请在答案中更新它,这样它对我和其他人也有帮助谢谢
标签: elasticsearch