Group by and sum

hi all and sorry for my poor english
I tried with no success to create an aggregation query that group hits by a field "category" and get a sum of field "eventCount". Please help