【发布时间】:2015-07-30 18:15:08
【问题描述】:
{
class: 1,
users: [{
name: 'abc',
surname: 'def'
}, {
name: 'xyz',
surname: 'wef'
}, {
name: 'abc',
surname: 'pqr'
}]
}
我有一个类似上述对象的文档结构,我只想返回名称为“abc”的用户,但问题是它与名称“abc”匹配但返回 所有数组。我只想要匹配的用户。
映射 -
{
"class":"string",
"users" : {
"type" : "nested",
"properties": {
"name" : {"type": "string" },
"surname" : {"type": "string" }
}
}
}
【问题讨论】:
-
你能显示你的查询吗?可能还有你的映射?
标签: elasticsearch