gpt4 book ai didi

elasticsearch - Elastic 6. *中按对象数组进行多次过滤

转载 作者:行者123 更新时间:2023-12-03 00:52:39 25 4
gpt4 key购买 nike

在ElasticSearch 6中通过数组构建查询时需要帮助。我有一些文档,这些文档代表一些具有多个属性的属性单元:

{  
"Unit":{
"Attributes":{
"Attribute":[
{
"Name":"Elevator",
"Text":"No"
},
{
"Name":"Pet Friendly",
"Text":"Yes"
}
...
]
}
}
}

如何过滤我的文件以查找所有宠物友善的单位或所有没有电梯的单位?

附言我正在使用NEST。

最佳答案

Map Attribute 作为 nested type,可能已将Text映射为keyword进行术语级别匹配。要查询,请使用带有bool子句的 filter query,其中子句将为 nested queries

关于elasticsearch - Elastic 6. *中按对象数组进行多次过滤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50698262/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com