gpt4 book ai didi

elasticsearch - Elasticsearch范围查询对象列表

转载 作者:行者123 更新时间:2023-12-03 01:44:08 25 4
gpt4 key购买 nike

这是我的 map

{             "seoSubscribedFlag": {"type": "boolean"},
"seoSubscribedExpiryDate": {"type": "date"},
"userActive" :{"type" : "boolean"},
"emailVerified" :{"type" : "boolean"},
"isOnLineShodAdded" :{"type" : "boolean"},
"productList" : {
"properties" : {
"prodId" : {"type" : "string"},
"prodName" : {"type" : "string"},
"brand" : {"type" : "string"},
"modelNo" : {"type" : "string"},

"grossAmt" : {"type" : "float"},
"netAmt" : {"type" : "float"},
"prodDesc" : {"type" : "string"},
"prodKeyFeatures" : {"type" : "string"},
"prodSize" :{ "type": "nested" }

}
}
}

这是我的乔恩
{
"userId": "2",
"seoSubscribedFlag": true,
"seoSubscribedExpiryDate": 1501312549,
"userActive" : true,
"emailVerified" : true,
"isOnLineShodAdded" : false,
"productList" : {
"properties" : {
"prodId" : "2",
"netAmt" : 50,
"prodSize" :["XS","XL"]

}
}
}

我想使用BOOL必须基于产品netAmt搜索数据,
就像netAmt必须在10到60之间
我尝试BOOL必须范围,但它不适用于对象列表
enter image description here

最佳答案

{
"query": {
"bool": {
"must": {
"range": {
"productList.netAmt": {
"gt": 10,
"lt": 60
}
}
}
}
}
}

请引用ES range query

关于elasticsearch - Elasticsearch范围查询对象列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45411048/

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