Examples of source()


Examples of org.elasticsearch.action.search.SearchRequest.source()

        final SearchRequest request = srb.setSearchType(SearchType.SCAN)
                .setScroll(new TimeValue(1, TimeUnit.MINUTES))
                .setSize(500).request(); // TODO magic numbers
        if (LOG.isDebugEnabled()) {
            try {
                LOG.debug("ElasticSearch scroll query: {}", XContentHelper.convertToJson(request.source(), false));
            } catch (IOException ignored) {
            }
        }
        final SearchResponse r = c.search(request).actionGet();
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequest.source()

        }

        SearchRequest request = searchRequest(config, indexNames).request();

        SearchResponse r = c.search(request).actionGet();
        return new SearchResult(r.getHits(), indices, config.query(), request.source(), r.getTook());
    }

    public TermsResult terms(String field, int size, String query, String filter, TimeRange range) throws IndexHelper.InvalidRangeFormatException {
        if (size == 0) {
            size = 50;
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequest.source()

        SearchResponse r = c.search(request).actionGet();

        return new TermsResult(
                (TermsFacet) r.getFacets().facet(TERMS_FACET_NAME),
                query,
                request.source(),
                r.getTook()
        );
    }

    public TermsResult terms(String field, int size, String query, TimeRange range) throws IndexHelper.InvalidRangeFormatException {
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequest.source()

        SearchResponse r = c.search(request).actionGet();

        return new TermsStatsResult(
                (TermsStatsFacet) r.getFacets().facet(TERMS_STATS_FACET_NAME),
                query,
                request.source(),
                r.getTook()
        );
    }

    public TermsStatsResult termsStats(String keyField, String valueField, TermsStatsOrder order, int size, String query, TimeRange range) throws IndexHelper.InvalidRangeFormatException {
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequest.source()

        return new FieldStatsResult(
                (StatisticalFacet) r.getFacets().facet(STATS_FACET_NAME),
                r.getHits(),
                query,
                request.source(),
                r.getTook()
        );
    }

    public HistogramResult histogram(String query, DateHistogramInterval interval, TimeRange range) throws IndexHelper.InvalidRangeFormatException {
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequest.source()

        srb.addFacet(fb);

        final SearchRequest request = srb.request();
        SearchResponse r = c.search(request).actionGet();
        return new DateHistogramResult((DateHistogramFacet) r.getFacets().facet("histogram"), query,
                request.source(),
                interval, r.getTook());
    }

    public HistogramResult fieldHistogram(String query, String field, DateHistogramInterval interval, String filter, TimeRange range) throws FieldTypeException, IndexHelper.InvalidRangeFormatException {
        DateHistogramFacetBuilder fb = FacetBuilders.dateHistogramFacet("histogram")
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequest.source()

            r = c.search(request).actionGet();
        } catch (org.elasticsearch.action.search.SearchPhaseExecutionException e) {
            throw new FieldTypeException(e);
        }

        return new FieldHistogramResult((DateHistogramFacet) r.getFacets().facet("histogram"), query, request.source(),
                interval, r.getTook());
    }

    public SearchHit firstOfIndex(String index) {
        return oneOfIndex(index, matchAllQuery(), SortOrder.DESC);
View Full Code Here

Examples of org.elasticsearch.action.search.SearchRequest.source()

                                        searchRequest.types(types);
                                    }

                                    ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
                                    builder.put("query", (Map) mapQuery.get("query"));
                                    searchRequest.source(builder.build());

                                    if (searchSourceBuilder != null) {
                                        searchRequest.extraSource(searchSourceBuilder);
                                    }
View Full Code Here

Examples of org.elasticsearch.action.update.UpdateRequest.source()

        updateRequest.versionType(VersionType.fromString(request.param("version_type"), updateRequest.versionType()));


        // see if we have it in the body
        if (request.hasContent()) {
            updateRequest.source(request.content());
            IndexRequest upsertRequest = updateRequest.upsertRequest();
            if (upsertRequest != null) {
                upsertRequest.routing(request.param("routing"));
                upsertRequest.parent(request.param("parent")); // order is important, set it after routing, so it will set the routing
                upsertRequest.timestamp(request.param("timestamp"));
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.MappingMetaData.source()

                .prepareState()
                .setIndices(IndexService.INDEX_DEFAULT)
                .execute().actionGet().getState();
        MappingMetaData mappingMetaData = state.getMetaData().index(indexName).mapping(indexType);
        if (mappingMetaData != null) {
            return mappingMetaData.source().toString();
        } else {
            return null;
        }
    }
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.