public void analyze() {
        concreteHitCount = 0;
        setFilledInternal(null);
        notCachedCount = 0;
        hitsWithSortData = 0;

        Set<String> filled = getFilledInternal();

        Iterator<Hit> i = unorderedIterator();
        while (filled == null && i.hasNext()) {
            Hit hit = i.next();
            analyzeHit(hit);
            Set<String> hitFilled = hit.getFilled();
            if (hitFilled != null) {
                //TODO Avoid needing set that allows null ....
                filled = (hitFilled.size() == 1)
                        ? Collections.singleton(hitFilled.iterator().next())
                        : hitFilled.isEmpty() ? null : new HashSet<>(hitFilled);
                setFilledInternal(filled);
            }
        }
        String singleKey = null;
        if (filled != null && filled.size() == 1) {
            singleKey = filled.iterator().next();
        }


        while (i.hasNext()) {
            Hit hit = i.next();
            analyzeHit(hit);

            if (filled != null) {
                Set<String> hitFilled = hit.getFilled();
                if (hitFilled == null) {
                    // Intentionally empty. Strange semantic, null -> matches everything
                } else if (hitFilled.isEmpty()) {
                    filled = null; // No intersection
                    setFilledInternal(filled);
                } else {
                    if (filled.size() == 1) {
                        if ( ! hitFilled.contains(singleKey)) {
                            filled = null; // No intersection
                            setFilledInternal(filled);
                            singleKey = null;
                        }
                    } else {
                        filled.retainAll(hitFilled);
                        if (filled.size() == 1) {
                            singleKey = filled.iterator().next();
                        }
                    }
                }
            }
        }
    }
Update concreteHitCount, cached and filled by iterating trough the hits of this result.
Recursively also update all subgroups.
container-search/src/main/java/com/yahoo/search/result/HitGroup.java