How does AVG with elastic work?

I have now added 3 to index test.

With

statement{ “numbermax” : 6}
statement{ “numbermax” : 6}
statement{ “numbermax” : 9}

If I order that in the metrics the sum of numbermax appears. Somehow I expected the average, means (6+6+9)/3