如果我搜索包含列表的字段,我正在尝试返回单个值。 tags
是我的列表,我有一个,两个和三个值。
tags : ["one", "two", "three"]
如果我在tags
字段中搜索“two”,我只想在结果中返回“two”值。
如果我使用嵌套对象,实现此目的的正确映射是什么?如果是这样,我可以使用下面的当前映射吗?
{
"document": {
"properties": {
"tags":{
"type": "multi_field",
"fields":{
"tags" {
"type": "string",
"index": "analyzed"
},
"untouched": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}