private ResultCreator getDefaultResultCreator(final SearchRequest searchRequest,
                                                  final String componentId,
                                                  final ExpressionContext expressionContext,
                                                  final ResultRequest resultRequest,
                                                  final boolean cacheLastResult) {
        return cachedResultCreators.computeIfAbsent(componentId, k -> {
            ResultCreator resultCreator;
            try {
                if (ResultStyle.TABLE.equals(resultRequest.getResultStyle())) {
                    final FormatterFactory formatterFactory = new FormatterFactory(searchRequest.getDateTimeSettings());
                    resultCreator = new TableResultCreator(
                            formatterFactory,
                            expressionPredicateFactory,
                            cacheLastResult);

                } else if (ResultStyle.VIS.equals(resultRequest.getResultStyle())) {
                    final FlatResultCreator flatResultCreator = new FlatResultCreator(
                            mapDataStoreFactory,
                            searchRequest,
                            componentId,
                            expressionContext,
                            null,
                            null,
                            expressionPredicateFactory,
                            sizesProvider.getDefaultMaxResultsSizes(),
                            cacheLastResult);
                    resultCreator = new VisResultCreator(flatResultCreator);

                } else if (ResultStyle.QL_VIS.equals(resultRequest.getResultStyle())) {
                    final FlatResultCreator flatResultCreator = new FlatResultCreator(
                            mapDataStoreFactory,
                            searchRequest,
                            componentId,
                            expressionContext,
                            null,
                            null,
                            expressionPredicateFactory,
                            sizesProvider.getDefaultMaxResultsSizes(),
                            cacheLastResult);
                    resultCreator = new QLVisResultCreator(flatResultCreator, resultRequest
                            .getMappings()
                            .getLast()
                            .getVisSettings());

                } else {
                    resultCreator = new FlatResultCreator(
                            mapDataStoreFactory,
                            searchRequest,
                            componentId,
                            expressionContext,
                            null,
                            null,
                            expressionPredicateFactory,
                            sizesProvider.getDefaultMaxResultsSizes(),
                            cacheLastResult);
                }
            } catch (final RuntimeException e) {
                throw new RuntimeException(e.getMessage());
            }

            return resultCreator;
        });
    }
Build a {@link SearchResponse} from the passed {@link SearchRequest}.

@param searchRequest The {@link SearchRequest} containing the query terms and the result requests
@return A {@link SearchResponse} object that may be one of:
<ul>
<li>A 'complete' {@link SearchResponse} containing all the data requested</li>
<li>An incomplete {@link SearchResponse} containing none, some or all of the data requested, i.e the
currently know results at the point the request is made.</li>
<li>An empty response with an error message indicating the request timed out waiting for a 'complete'
result set. This only applies to non-incremental queries.</li>
<li>An empty response with a different error message. This will happen when some unexpected error has
occurred while assembling the {@link SearchResponse}</li>
</ul>
stroom-query/stroom-query-common/src/main/java/stroom/query/common/v2/SearchResponseCreator.java