public final void ensureFilled(Result result, String summaryClass, Execution execution) {
        if (summaryClass == null)
            summaryClass = PartialSummaryHandler.resolveSummaryClass(result);

        String alsoCheck = PartialSummaryHandler.enoughFields(summaryClass, result);
        var hasFilled = result.hits().getFilled();
        if (hasFilled == null || hasFilled.contains(summaryClass) || hasFilled.contains(alsoCheck)) {
            int fillRejectTraceAt = 3;
            if (result.getQuery().getTrace().getLevel() >= fillRejectTraceAt)
                result.getQuery().trace("Ignoring fill(" + summaryClass + "): " +
                                        ( hasFilled == null ? "Hits are unfillable" : "Hits already filled" ) +
                                        ": result.hits().getFilled()=" + hasFilled, fillRejectTraceAt);
        }
        else {
            int fillStartTraceAt = 6;
            if (result.getQuery().getTrace().getLevel() >= fillStartTraceAt)
                result.getQuery().trace("Hits need fill(" + summaryClass + "); hasFilled=" + hasFilled + " in " + this.getClass(), fillStartTraceAt);
            fill(result, summaryClass, execution);
        }
    }
Fills the result if it is not already filled for the given summary class.
See the fill method.
container-search/src/main/java/com/yahoo/search/Searcher.java