Examples of queryResult()


Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

                throw new ElasticSearchException("Scroll must be provided when scanning...");
            }
            contextProcessing(context);
            queryPhase.execute(context);
            contextProcessedSuccessfully(context);
            return context.queryResult();
        } catch (RuntimeException e) {
            logger.trace("Scan phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

            if (context.scroll() == null || context.fetchResult().hits().hits().length < context.size()) {
                freeContext(request.id());
            } else {
                contextProcessedSuccessfully(context);
            }
            return new ScrollQueryFetchSearchResult(new QueryFetchSearchResult(context.queryResult(), context.fetchResult()), context.shardTarget());
        } catch (RuntimeException e) {
            logger.trace("Scan phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

            if (context.searchType() == SearchType.COUNT) {
                freeContext(context.id());
            } else {
                contextProcessedSuccessfully(context);
            }
            return context.queryResult();
        } catch (RuntimeException e) {
            logger.trace("Query phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

        try {
            contextProcessing(context);
            processScroll(request, context);
            contextProcessedSuccessfully(context);
            queryPhase.execute(context);
            return new ScrollQuerySearchResult(context.queryResult(), context.shardTarget());
        } catch (RuntimeException e) {
            logger.trace("Query phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

            throw new QueryPhaseExecutionException(context, "Failed to set aggregated df", e);
        }
        try {
            queryPhase.execute(context);
            contextProcessedSuccessfully(context);
            return context.queryResult();
        } catch (RuntimeException e) {
            logger.trace("Query phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

            if (context.scroll() == null) {
                freeContext(context.id());
            } else {
                contextProcessedSuccessfully(context);
            }
            return new QueryFetchSearchResult(context.queryResult(), context.fetchResult());
        } catch (RuntimeException e) {
            logger.trace("Fetch phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

            if (context.scroll() == null) {
                freeContext(request.id());
            } else {
                contextProcessedSuccessfully(context);
            }
            return new QueryFetchSearchResult(context.queryResult(), context.fetchResult());
        } catch (RuntimeException e) {
            logger.trace("Fetch phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

            if (context.scroll() == null) {
                freeContext(request.id());
            } else {
                contextProcessedSuccessfully(context);
            }
            return new ScrollQueryFetchSearchResult(new QueryFetchSearchResult(context.queryResult(), context.fetchResult()), context.shardTarget());
        } catch (RuntimeException e) {
            logger.trace("Fetch phase failed", e);
            freeContext(context);
            throw e;
        } finally {
View Full Code Here

Examples of org.elasticsearch.search.internal.SearchContext.queryResult()

            assert context.searchType() != SearchType.COUNT : "searchType COUNT is not supported using QueryShardRequests";
            contextProcessedSuccessfully(context);

            context.indexShard().searchService().onQueryPhase(context, System.nanoTime() - time);
            return context.queryResult();
        } catch (Throwable e) {
            context.indexShard().searchService().onFailedQueryPhase(context);
            logger.trace("Query phase failed", e);
            freeContext(context.id());
            throw ExceptionsHelper.convertToRuntime(e);
View Full Code Here

Examples of org.elasticsearch.search.query.QuerySearchResult.queryResult()

    }

    @Test public void testScan() throws Exception {
        Scroll scroll = new Scroll(TimeValue.timeValueMillis(500));
        QuerySearchResult scanResult = searchService.executeScan(searchRequest(searchSource().query(matchAllQuery()).size(2), SearchType.SCAN).scroll(scroll));
        assertThat(scanResult.queryResult().topDocs().totalHits, equalTo(5));

        Set<String> idsLoaded = Sets.newHashSet();
        // start scrolling
        FetchSearchResult fetchResult = searchService.executeScan(new InternalScrollSearchRequest(scanResult.id()).scroll(scroll)).result().fetchResult();
        assertThat(fetchResult.hits().hits().length, equalTo(2));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.