Elastic “from” cannot take effect after aggregation

POST /dw_vehicle_mileage3/_search
{
"from": 10,
"aggs": {
"2": {
"terms": {
"field": "vehicleid",
"size": 1,
"order": {
"1": "desc"
}
},
"aggs": {
"1": {
"sum": {
"field": "distance"
}
},
"3": {
"sum": {
"field": "duration"
}
}
}
}
},
"size": 1,
"_source": {
"excludes":
},
"stored_fields": [
"*"
],
"script_fields": {},
"docvalue_fields": [
{
"field": "begintimedate",
"format": "date_time"
}
],
"query": {
"bool": {
"must": [
{
"match_all": {}
},
{
"range": {
"datetimec": {
"gte": 20180518,
"lt": 20180519
}
}
}
],
"filter": ,
"should": ,
"must_not":
}
}
}

Not sure what your question is.
From and size parameters don't have any influence on the aggs part.

1 Like

Hello, I want to paginate through from and size, but now I can only return the total size by setting size

I want to do something like limit 1,3 for SQL
Get the value starting at 3, but not now

You probably need something like https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-aggregations-bucket-composite-aggregation.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.