public void startNewSearch(final ExpressionOperator expression,
                               final List<Param> params,
                               final TimeRange timeRange,
                               final boolean incremental,
                               final boolean storeHistory,
                               final String queryInfo,
                               final String resumeNode,
                               final QueryKey resumeQueryKey) {
        GWT.log("SearchModel - startNewSearch()");

        // Destroy the previous search and ready all components for a new search to begin.
        reset(DestroyReason.NO_LONGER_NEEDED);

        // If we are resuming then set the node and query key.
        currentNode = resumeNode;
        currentQueryKey = resumeQueryKey;

        final Map<String, ComponentSettings> resultComponentMap = createComponentSettingsMap();
        if (resultComponentMap != null) {
            final DocRef dataSourceRef = indexLoader.getLoadedDataSourceRef();
            if (dataSourceRef != null && expression != null) {
                // Copy the expression.
                ExpressionOperator currentExpression = ExpressionUtil.copyOperator(expression);
                currentSearch = Search
                        .builder()
                        .dataSourceRef(dataSourceRef)
                        .expression(currentExpression)
                        .componentSettingsMap(resultComponentMap)
                        .params(params)
                        .timeRange(timeRange)
                        .incremental(incremental)
                        .queryInfo(queryInfo)
                        .build();
            }
        }

        if (resultComponentMap != null) {
            final DocRef dataSourceRef = indexLoader.getLoadedDataSourceRef();
            if (dataSourceRef != null && expression != null) {
                // Let the query presenter know search is active.
                setSearching(true);

                // Reset all result components and tell them that search is
                // starting.
                resultComponents.values().forEach(ResultComponent::reset);
                resultComponents.values().forEach(ResultComponent::startSearch);

                // Start polling.
                polling = true;
                poll(Fetch.ALL, storeHistory);
            }
        }
    }
Begin executing a new search using the supplied query expression.
stroom-core-client/src/main/java/stroom/dashboard/client/main/SearchModel.java