Package org.elasticsearch.action.search

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


                                        }
                                    }

                                    SearchRequest searchRequest = new SearchRequest();
                                    if (indices != null) {
                                        searchRequest.indices(indices);
                                    }
                                    if (types != null) {
                                        searchRequest.types(types);
                                    }
View Full Code Here


    }

    private SearchRequest buildRequest(ESUpdateNode node) {

        SearchRequest searchRequest = new SearchRequest();
        searchRequest.indices(node.indices());
        searchRequest.types(Constants.DEFAULT_MAPPING_TYPE);
        searchRequest.preference("_primary");

        searchRequest.routing(node.whereClause().clusteredBy().orNull());
        try {
View Full Code Here

            competitor.settings().merge(settings);
            if (competitor.settings().searchRequests().isEmpty()) {
                for (SearchRequest defaultSearchRequest : settings.searchRequests()) {
                    SearchRequest copy = new SearchRequest();
                    if (defaultSearchRequest.indices() != null) {
                        copy.indices(defaultSearchRequest.indices());
                    }
                    copy.types(defaultSearchRequest.types());
                    copy.searchType(defaultSearchRequest.searchType());
                    copy.source(defaultSearchRequest.source(), true);
                    copy.extraSource(defaultSearchRequest.extraSource(), true);
View Full Code Here

    }

    @Test
    public void testSearchRequestTemplateSource() throws Exception {
        SearchRequest searchRequest = new SearchRequest();
        searchRequest.indices("_all");

        String query = "{ \"template\" : { \"query\": {\"match_{{template}}\": {} } }, \"params\" : { \"template\":\"all\" } }";
        BytesReference bytesRef = new BytesArray(query);
        searchRequest.templateSource(bytesRef, false);
View Full Code Here

    @Test
    // Releates to #6318
    public void testSearchRequestFail() throws Exception {
        SearchRequest searchRequest = new SearchRequest();
        searchRequest.indices("_all");
        try {
            String query = "{ \"template\" : { \"query\": {\"match_all\": {}}, \"size\" : \"{{my_size}}\"  } }";
            BytesReference bytesRef = new BytesArray(query);
            searchRequest.templateSource(bytesRef, false);
            client().search(searchRequest).get();
View Full Code Here

            // the request.
            final ClusteringActionRequestBuilder actionBuilder = new ClusteringActionRequestBuilder(client);
            switch (request.method()) {
                case POST:
                    SearchRequest searchRequest = new SearchRequest();
                    searchRequest.indices(Strings.splitStringByCommaToArray(request.param("index")));
                    searchRequest.types(Strings.splitStringByCommaToArray(request.param("type")));
                    actionBuilder.setSearchRequest(searchRequest);
                    actionBuilder.setSource(request.content());
                    break;
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.