Is it possible to do this in one search: select count(1), sum(field1) from table where condition group by field2

without count(1), it is sample, but is it possible if with count and do it in one search?

See aggregations. They do exactly this.