Examples of preference()


Examples of crate.elasticsearch.action.export.ExportRequest.preference()

                    }
                }
            }
            exportRequest.routing(request.param("routing"));
            exportRequest.types(splitTypes(request.param("type")));
            exportRequest.preference(request.param("preference", "_primary"));
        } catch (Exception e) {
            try {
                XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                channel.sendResponse(new XContentRestResponse(request, BAD_REQUEST, builder.startObject().field("error", e.getMessage()).endObject()));
            } catch (IOException e1) {
View Full Code Here

Examples of crate.elasticsearch.action.searchinto.SearchIntoRequest.preference()

                    }
                }
            }
            searchIntoRequest.routing(request.param("routing"));
            searchIntoRequest.types(splitTypes(request.param("type")));
            searchIntoRequest.preference(request.param("preference",
                    "_primary"));
        } catch (Exception e) {
            try {
                XContentBuilder builder = RestXContentBuilder
                        .restContentBuilder(
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.shards.ClusterSearchShardsRequest.preference()

        clusterSearchShardsRequest.local(request.paramAsBoolean("local", clusterSearchShardsRequest.local()));
        clusterSearchShardsRequest.listenerThreaded(false);

        clusterSearchShardsRequest.types(Strings.splitStringByCommaToArray(request.param("type")));
        clusterSearchShardsRequest.routing(request.param("routing"));
        clusterSearchShardsRequest.preference(request.param("preference"));
        clusterSearchShardsRequest.indicesOptions(IndicesOptions.fromRequest(request, clusterSearchShardsRequest.indicesOptions()));

        client.admin().cluster().searchShards(clusterSearchShardsRequest, new RestToXContentListener<ClusterSearchShardsResponse>(channel));
    }
}
View Full Code Here

Examples of org.elasticsearch.action.count.CountRequest.preference()

            }
        }
        countRequest.routing(request.param("routing"));
        countRequest.minScore(request.paramAsFloat("min_score", DEFAULT_MIN_SCORE));
        countRequest.types(Strings.splitStringByCommaToArray(request.param("type")));
        countRequest.preference(request.param("preference"));

        final int terminateAfter = request.paramAsInt("terminate_after", DEFAULT_TERMINATE_AFTER);
        if (terminateAfter < 0) {
            throw new ElasticsearchIllegalArgumentException("terminateAfter must be > 0");
        } else if (terminateAfter > 0) {
View Full Code Here

Examples of org.elasticsearch.action.exists.ExistsRequest.preference()

            }
        }
        existsRequest.routing(request.param("routing"));
        existsRequest.minScore(request.paramAsFloat("min_score", DEFAULT_MIN_SCORE));
        existsRequest.types(Strings.splitStringByCommaToArray(request.param("type")));
        existsRequest.preference(request.param("preference"));

        client.exists(existsRequest, new RestBuilderListener<ExistsResponse>(channel) {
            @Override
            public RestResponse buildResponse(ExistsResponse response, XContentBuilder builder) throws Exception {
                RestStatus status = response.exists() ? OK : NOT_FOUND;
View Full Code Here

Examples of org.elasticsearch.action.explain.ExplainRequest.preference()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final ExplainRequest explainRequest = new ExplainRequest(request.param("index"), request.param("type"), request.param("id"));
        explainRequest.parent(request.param("parent"));
        explainRequest.routing(request.param("routing"));
        explainRequest.preference(request.param("preference"));
        String sourceString = request.param("source");
        String queryString = request.param("q");
        if (request.hasContent()) {
            explainRequest.source(request.content(), request.contentUnsafe());
        } else if (sourceString != null) {
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.preference()

        getRequest.listenerThreaded(false);
        // if we have a local operation, execute it on a thread since we don't spawn
        getRequest.operationThreaded(true);
        getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh()));
        getRequest.routing(request.param("routing"));
        getRequest.preference(request.param("preference"));
        getRequest.realtime(request.paramAsBoolean("realtime", null));

        String sField = request.param("fields");
        if (sField != null) {
            String[] sFields = Strings.splitStringByCommaToArray(sField);
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.preference()

        percolateRequest.documentType(restRequest.param("percolate_type", type));

        GetRequest getRequest = new GetRequest(index, type,
                restRequest.param("id"));
        getRequest.routing(restRequest.param("routing"));
        getRequest.preference(restRequest.param("preference"));
        getRequest.refresh(restRequest.paramAsBoolean("refresh", getRequest.refresh()));
        getRequest.realtime(restRequest.paramAsBoolean("realtime", null));
        getRequest.version(RestActions.parseVersion(restRequest));
        getRequest.versionType(VersionType.fromString(restRequest.param("version_type"), getRequest.versionType()));
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.preference()

                    }
                    getRequest.index((String) value);
                } else if ("type".equals(entry.getKey())) {
                    getRequest.type((String) value);
                } else if ("preference".equals(entry.getKey())) {
                    getRequest.preference((String) value);
                } else if ("routing".equals(entry.getKey())) {
                    getRequest.routing((String) value);
                } else if ("percolate_index".equals(entry.getKey()) || "percolate_indices".equals(entry.getKey()) || "percolateIndex".equals(entry.getKey()) || "percolateIndices".equals(entry.getKey())) {
                    if (value instanceof String[]) {
                        percolateRequest.indices((String[]) value);
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.preference()

                percolateRequest.documentType(getRequest.type());
            }
            if (percolateRequest.routing() == null && getRequest.routing() != null) {
                percolateRequest.routing(getRequest.routing());
            }
            if (percolateRequest.preference() == null && getRequest.preference() != null) {
                percolateRequest.preference(getRequest.preference());
            }
        } else {
            for (Map.Entry<String, Object> entry : header.entrySet()) {
                Object value = entry.getValue();
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.