@Override
    protected void onSerialize(Serializer buf) {
        super.onSerialize(buf);
        byte[] raw = Utf8.toBytes(summaryClass);
        buf.putInt(null, raw.length);
        buf.put(null, raw);

        buf.putInt(null, maxHits);
        int numHits = hits.size();
        buf.putInt(null, numHits);
        for (Hit h : hits) {
            serializeOptional(buf, h);
        }
    }
Adds a hit to this aggregation result

@param h the hit
@return this object
searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java