private void getStoredData(final Map<String, Val> valueMap) {
            try {
                Val[] values = null;

                for (int i = 0; i < fieldNames.length; i++) {
                    final String fieldName = fieldNames[i];
                    // If the field is not in fact stored then it will be null here.
                    if (fieldName != null) {
                        final Val value = valueMap.get(fieldName);
                        if (value != null) {
                            if (values == null) {
                                values = new Val[fieldNames.length];
                            }
                            values[i] = value;
                        }
                    }
                }

                if (values != null) {
                    valuesConsumer.accept(Val.of(values));
                }
            } catch (final RuntimeException e) {
                error(e);
            }
        }
This method takes a list of document id's and extracts the stored fields
that are required for data display. In some cases such as batch search we
only want to get stream and event ids, in these cases no values are
retrieved, only stream and event ids.
stroom-search/stroom-search-solr/src/main/java/stroom/search/solr/search/SolrSearchTaskHandler.java