2015-02-11 26 views
2

如何在elasticsearch聚合中使用分页(size和from),我使用了Size和from agreggition,它抛出了exmaple的异常。
我想查询吗?如何在弹性搜索聚合中使用分页(大小和来源)?

GET /索引/ nameorder/_search

{ 
    "size": 0, 
    "query": { 
     "filtered": { 
      "query": { 
       "bool": { 
        "must": [ 
         { 
          "match": { 
           "projectId": "10057" 
          } 
         } 
        ] 
       } 
      }, 
      "filter": { 
       "range": { 
        "purchasedDate": { 
         "from": "2012-02-05T00:00:00", 
         "to": "2015-02-11T23:59:59" 
        } 
       } 
      } 
     } 
    }, 
    "aggs": { 
     "group_by_a": { 
      "terms": { 
       "field": "promocode", 
       "size": 40, 
       "from": 40 
      }, 
      "aggs": { 
       "TotalPrice": { 
        "sum": { 
         "field": "subtotalPrice" 
        } 
       } 
      } 
     } 
    } 
} 
+0

是不是这个弹性搜索? Y是你把它标记为mongodb – mallik 2015-02-11 14:09:58

+0

[Paginate Elasticseach聚合器结果]的可能重复(http://stackoverflow.com/questions/25865687/paginate-elasticseach-aggregator-result) – 2015-02-12 01:24:58

+0

是的它是弹性搜索。 – 2015-02-12 08:58:54

回答