private Object getFieldValue(final Map<String, JsonData> searchHitMap, final String fieldName) {
        if (fieldName == null || !searchHitMap.containsKey(fieldName)) {
            return null;
        }

        JsonArray docField = searchHitMap.get(fieldName).toJson().asJsonArray();
        if (docField.size() > 1) {
            return docField.stream()
                    .map(this::jsonValueToNative)
                    .toList();
        } else {
            return jsonValueToNative(docField.get(0));
        }
    }
Locate the value of the doc field by its full path
stroom-search/stroom-search-elastic/src/main/java/stroom/search/elastic/search/ElasticSearchTaskHandler.java