@Override
    public FieldValue setFieldValue(StructuredFieldValue doc, FieldValue fv) {
        FieldValue old = getFieldValue(doc);
        StringFieldValue sfv = (StringFieldValue) fv;
        super.setFieldValue(doc, sfv);
        Map<String, SpanTree> trees = null;
        if (sfv != null) {
            trees = sfv.getSpanTreeMap();
            if (trees == null) {
                trees = new HashMap<>();
            }
        }
        extractSpanTrees.set(doc, trees);
        return old;
    }
This adds an Extractor to the ExtendedField that can be used to get access the backed spantrees
used in the concrete document types.
@author baldersheim
document/src/main/java/com/yahoo/document/ExtendedStringField.java