How to sum a filed in top N document

hi all , i have a problem with es.
i find N documentfrom es via order by a filed--logtime, and then i want to sum a filed--delta in those top n document.
i tried top-hits ,but this agg can't add aggs any more.
and i try use code blow.
But i can't get the right i want.
please help me.
here is my code:
{
"size" : 0,
"query" : {
"bool" : {
"must" : {
"match" : {
"userid" : {
"query" : "447494679",
"type" : "boolean"
}
}
}
}
},
"sort" : [ {
"logtime" : {
"order" : "desc"
}
} ],
"aggs" : {
"term" : {
"terms" : {
"field" : "userid",
"size":10
},
"aggs" : {
"sum" : {
"sum" : {
"field":"delta"
}
}
}
}
}
}'