我正在处理具有类型字符串数组的文档字段的自动完成建议.我的文件如下;
{
"title": "Product1",
"sales": "6",
"rating": "0.0",
"cost": "45.00",
"tags": [
"blog",
"magazine",
"responsive",
"two columns",
"wordpress"
],
"category": "wordpress",
"description": "Product1 Description",
"createDate": "2013-12-19"
}
{
"title": "Product1",
"sales": "6",
"rating": "0.0",
"cost": "45.00",
"tags": [
"blog",
"paypal",
"responsive",
"skrill",
"wordland"
],
"category": "wordpress",
"description": "Product1 Description",
"createDate": "2013-12-19"
}
Run Code Online (Sandbox Code Playgroud)
我正在标签字段上执行自动完成搜索.我的查询是这样的;
query: {
query_string: {
query: "word*",
fields: ["tags"]
}
},
facets: {
tags: {
terms: {
field: "tags"
}
}
}
Run Code Online (Sandbox Code Playgroud)
当用户输入"word"时,我想显示"wordland"和"wordpress".但是,我无法做到这一点.
你能帮忙吗?
谢谢