private void highlight(boolean bolding, Iterator<Hit> hitsToHighlight, IndexFacts.Session indexFacts) {
        while (hitsToHighlight.hasNext()) {
            Hit hit = hitsToHighlight.next();
            if ( ! (hit instanceof FastHit fastHit)) continue;
            Object searchDefinitionField = fastHit.getField(Hit.SDDOCNAME_FIELD);
            if (searchDefinitionField == null) continue;

            for (Index index : indexFacts.getIndexes(searchDefinitionField.toString())) {
                if (index.getDynamicSummary() || index.getHighlightSummary()) {
                    var field = fastHit.getField(index.getName());
                    if (StringArrayConverter.shouldHandleField(field)) {
                        new StringArrayConverter(fastHit, index, field, bolding);
                    } else {
                        HitField fieldValue = fastHit.buildHitField(index.getName(), true);
                        if (fieldValue != null) {
                            insertTags(fieldValue, bolding, index.getDynamicSummary());
                        }
                    }
                }
            }
        }
    }
Convert Juniper style property highlighting to XML style.
container-search/src/main/java/com/yahoo/prelude/searcher/JuniperSearcher.java