数据结构大概是这样
"list":[
{
"@timespan" : "2016-09-28T14:14:56.450024+08:00",
"_score" : 1,
"content" : {
"GoFlightInfos" : [
{
"AirCompanyCode" : "OZ",
"ArrAirportCode" : "PEK"
}
],
"HaveItinerary" : 2,
"IsAdjusted" : false,
"IsStandard" : false,
"MainAirCompanyCode" : "CA",
"MainBackAirCompanyCode" : "",
"MainBackSegmentIndex" : 0,
"MainSegmentIndex" : 0,
"ResConfigId" : 0,
"ResPrice" : {
"ZSumPrice" : 2915,
"aPrice":20
}
},
"id" : "39b71b2922a8411b1db79c5461efc3b"
}
]
我想查询1:GoFlightInfos这个数组只有一个元素的这个id=39b71b2922a8411b1db79c5461efc3b的这个实体
2: SELECT MIN(a.prop1+a.prop2) FROM TABLE a 查一个这样sql的查询语句怎么写
比如以上实例,我想把zsumprice+aprice加起来再求最低价.
目前我只知道
{
"page": {
"size": "0",
"from": "0"
},
"aggs": {
"comments": {
"nested": {
"path": "content"
},
"aggs": {
"minprice": {
"min": {
"field": "content.ResPrice.ZSumPrice"
}
}
}
}
}
}
这个是求zsumprice的最低价
感激不尽!!!