假设我有3个具有下一个结构的对象:
{
"name": "Test_1",
"attributes":[
{
"name": "attribute_1"
},
{
"name": "attribute_2"
}
]
},
{
"name": "Test_2",
"attributes":[
{
"name": "attribute_1"
},
{
"name": "attribute_2"
},
{
"name": "attribute_3"
}
]
}
{
"name": "Test_3",
"attributes":[
{
"name": "attribute_2"
},
{
"name": "attribute_3"
}
]
}
存储在ElasticSearch中,我想查找只包含这些值的对象attributes.name = attribute_1,attribute_2
所以,作为结果,我想得到第一个对象,因为这个对象只包含那些指定的值,不多也不少
1条答案
按热度按时间e0bqpujr1#
如果您的字段是嵌套类型,我相信这个查询应该会对您有所帮助。