Examples of routing()


Examples of org.elasticsearch.action.delete.DeleteRequest.routing()

                            requestsByShard.put(shardIt.shardId(), list);
                        }
                        list.add(new BulkItemRequest(i, request));
                    }
                } else {
                    ShardId shardId = clusterService.operationRouting().deleteShards(clusterState, deleteRequest.index(), deleteRequest.type(), deleteRequest.id(), deleteRequest.routing()).shardId();
                    List<BulkItemRequest> list = requestsByShard.get(shardId);
                    if (list == null) {
                        list = Lists.newArrayList();
                        requestsByShard.put(shardId, list);
                    }
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteRequest.routing()

    // TODO: this was causing issues, do we need it?
    // deleteRequest.version(RestActions.parseVersion(request));
    // deleteRequest.versionType(VersionType.fromString(request.param("version_type"),
    // deleteRequest.versionType()));

    deleteRequest.routing(request.param("routing"));

    return deleteRequest;
  }

  /**
 
View Full Code Here

Examples of org.elasticsearch.action.deletebyquery.DeleteByQueryRequest.routing()

                }
            }
            deleteByQueryRequest.types(splitTypes(request.param("type")));
            deleteByQueryRequest.timeout(request.paramAsTime("timeout", ShardDeleteByQueryRequest.DEFAULT_TIMEOUT));

            deleteByQueryRequest.routing(request.param("routing"));
            String replicationType = request.param("replication");
            if (replicationType != null) {
                deleteByQueryRequest.replicationType(ReplicationType.fromString(replicationType));
            }
            String consistencyLevel = request.param("consistency");
View Full Code Here

Examples of org.elasticsearch.action.deletebyquery.DeleteByQueryRequest.routing()

        final DeleteByQueryRequest request = new DeleteByQueryRequest();

        try {
            request.source(queryBuilder.convert(deleteByQueryNode), false);
            request.indices(deleteByQueryNode.indices());
            request.routing(deleteByQueryNode.whereClause().clusteredBy().orNull());

            transportDeleteByQueryAction.execute(request, new ActionListener<DeleteByQueryResponse>() {
                @Override
                public void onResponse(DeleteByQueryResponse deleteByQueryResponses) {
                    result.set(TaskResult.ROW_COUNT_UNKNOWN);
View Full Code Here

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

                if (querySourceBuilder != null) {
                    existsRequest.source(querySourceBuilder);
                }
            }
        }
        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) {
View Full Code Here

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

    @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());
View Full Code Here

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

        // no need to have a threaded listener since we just send back a response
        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) {
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.routing()

        // Get the id from request or if not available generate an id for the document
        String id = request.hasParam("id") ? request.param("id") : getIdForDoc(doc);

        // create an IndexRequest for this document
        IndexRequest indexRequest = new IndexRequest(index, type, id);
        indexRequest.routing(request.param("routing"));
        indexRequest.parent(request.param("parent"));
        indexRequest.source(doc);
        indexRequest.timeout(request.paramAsTime("timeout", IndexRequest.DEFAULT_TIMEOUT));
        indexRequest.refresh(request.paramAsBoolean("refresh", indexRequest.refresh()));
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.routing()

                try {

                    // validate, if routing is required, that we got routing
                    MappingMetaData mappingMd = clusterState.metaData().index(request.index()).mapping(indexRequest.type());
                    if (mappingMd != null && mappingMd.routing().required()) {
                        if (indexRequest.routing() == null) {
                            throw new RoutingMissingException(indexRequest.index(), indexRequest.type(), indexRequest.id());
                        }
                    }

                    SourceToParse sourceToParse = SourceToParse.source(indexRequest.source()).type(indexRequest.type()).id(indexRequest.id())
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.routing()

                            throw new RoutingMissingException(indexRequest.index(), indexRequest.type(), indexRequest.id());
                        }
                    }

                    SourceToParse sourceToParse = SourceToParse.source(indexRequest.source()).type(indexRequest.type()).id(indexRequest.id())
                            .routing(indexRequest.routing()).parent(indexRequest.parent());
                    long version;
                    Engine.IndexingOperation op;
                    if (indexRequest.opType() == IndexRequest.OpType.INDEX) {
                        Engine.Index index = indexShard.prepareIndex(sourceToParse).version(indexRequest.version()).versionType(indexRequest.versionType()).origin(Engine.Operation.Origin.PRIMARY);
                        indexShard.index(index);
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.