-1
我在java 1.7.5中使用elastichsearch,並在控制檯查詢後我想將以下代碼轉換爲java代碼。這是一個具有多個子聚合的查詢,並導致我的困惑。將elasticsearch查詢轉換爲具有多聚合的java
{
"query": {
"bool": {
"must": [
{
"range": {
"rawlog.auAid": {
"from": "3007145536"
}
}
},
{
"term": {
"rawlog.ip": "118.70.204.171"
}
}
],
"must_not": [],
"should": []
}
},
"aggs": {
"articles_over_time": {
"date_histogram": {
"field": "loggedTime",
"interval": "second"
},
"aggs": {
"id": {
"terms": {
"field": "auAid"
}
},
"url": {
"terms": {
"field": "urlId1"
}
},
"devVerId": {
"terms": {
"field": "devVerId"
}
},
"devTypeId": {
"terms": {
"field": "devTypeId"
}
},
"osVerId": {
"terms": {
"field": "osVerId"
}
},
"browserId": {
"terms": {
"field": "browserId"
}
}
}
}
}
}
任何人都可以幫我執行它嗎?非常感謝
你使用的是java傳輸到Java REST客戶端的elasticsearch?你可以包括你嘗試轉換它的java代碼嗎? – Phil
我在使用傳輸客戶端在elastichSearch 1.7.5 - – VanThaoNguyen
查看http://javadoc.kyubu.de/elasticsearch/HEAD/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramBuilder.html – Phil