private String formatIndexName() {
        final Matcher indexNameVariableMatcher = INDEX_NAME_VALUE_PATTERN.matcher(indexName);
        return indexNameVariableMatcher.replaceAll(matchResult -> {
            final String fieldNameMatch = matchResult.group();
            final String fieldName = fieldNameMatch.substring(1, fieldNameMatch.length() - 1);
            final String fieldValue = currentDocIndexNameVariables.get(fieldName);
            if (fieldValue == null) {
                throw new IllegalArgumentException("Field '" + fieldName + "' not found in document when " +
                                                   "building index name with pattern: '" + indexName + "'");
            }
            return fieldValue;
        });
    }
Build the index name, substituting values from the source document where specified.
For instance, consider an index name of `stroom-index-{_year}`. A field `<string key='_year'>2023</string>` in
the doc root will result in a destination index of `stroom-index-2023` for that document. In this case, because
the field `_year` starts with an underscore, it is not rendered to the doc and instead is solely used in the
index name.
stroom-search/stroom-search-elastic/src/main/java/stroom/search/elastic/indexing/ElasticIndexingFilter.java