Examples of type()


Examples of org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest.type()

                });
            }
        }
        if (updateMapping) {
            PutMappingRequest request = new PutMappingRequest(indices);
            request.type(Constants.DEFAULT_MAPPING_TYPE);
            request.source(analysis.tableParameter().mappings());
            final SettableFuture<?> future = SettableFuture.create();
            results.add(future);
            transportPutMappingAction.execute(request, new ActionListener<PutMappingResponse>() {
                @Override
View Full Code Here

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

                            new BulkItemResponse.Failure(indexRequest.index(), indexRequest.type(), indexRequest.id(), ExceptionsHelper.detailedMessage(e)));
                }
            } else if (item.request() instanceof DeleteRequest) {
                DeleteRequest deleteRequest = (DeleteRequest) item.request();
                try {
                    Engine.Delete delete = indexShard.prepareDelete(deleteRequest.type(), deleteRequest.id(), deleteRequest.version()).versionType(deleteRequest.versionType()).origin(Engine.Operation.Origin.PRIMARY);
                    indexShard.delete(delete);
                    // update the request with teh version so it will go to the replicas
                    deleteRequest.version(delete.version());

                    // add the response
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteResponse.type()

        logger.info("Delete [type1/1]");
        DeleteResponse deleteResponse = client1.prepareDelete("test", "type1", "1").setReplicationType(ReplicationType.SYNC).execute().actionGet();
        assertThat(deleteResponse.index(), equalTo(getConcreteIndexName()));
        assertThat(deleteResponse.id(), equalTo("1"));
        assertThat(deleteResponse.type(), equalTo("type1"));
        logger.info("Refreshing");
        client1.admin().indices().refresh(refreshRequest("test")).actionGet();

        logger.info("Get [type1/1] (should be empty)");
        for (int i = 0; i < 5; i++) {
View Full Code Here

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

            @Override
            public RestResponse buildResponse(ExplainResponse response, XContentBuilder builder) throws Exception {
                builder.startObject();
                //null checks for bw comp, since we only added in 1.4 index, type and id to ExplainResponse
                builder.field(Fields._INDEX, response.getIndex() != null ? response.getIndex() : explainRequest.index())
                        .field(Fields._TYPE, response.getType() != null ? response.getType() : explainRequest.type())
                        .field(Fields._ID, response.getId() != null ? response.getId() : explainRequest.id())
                        .field(Fields.MATCHED, response.isMatch());

                if (response.hasExplanation()) {
                    builder.startObject(Fields.EXPLANATION);
View Full Code Here

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

                    if (!allowExplicitIndex) {
                        throw new ElasticsearchIllegalArgumentException("explicit index in multi percolate is not allowed");
                    }
                    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())) {
View Full Code Here

Examples of org.elasticsearch.action.get.MultiGetRequest.Item.type()

      if (expected == item) return true;
      if (item == null) return false;
      if (expected.getClass() != item.getClass()) return false;
      Item other = (Item) item;
      return expected.index().equals(other.index())
          && expected.type().equals(other.type())
          && expected.id().equals(other.id())
          && Arrays.equals(expected.fields(), other.fields());
    }

    @Override
View Full Code Here

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

            if (item.request() instanceof IndexRequest) {
                IndexRequest indexRequest = (IndexRequest) item.request();
                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());
                        }
                    }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexResponse.type()

        startNode("data1", settingsBuilder().put("node.data", true).build());
        assertThat(client("nonData1").admin().cluster().prepareHealth().setWaitForNodes("3").execute().actionGet().timedOut(), equalTo(false));

        IndexResponse indexResponse = client("nonData2").index(Requests.indexRequest("test").type("type1").id("1").source(source("1", "test"))).actionGet();
        assertThat(indexResponse.id(), equalTo("1"));
        assertThat(indexResponse.type(), equalTo("type1"));
    }

    private String source(String id, String nameValue) {
        return "{ type1 : { \"id\" : \"" + id + "\", \"name\" : \"" + nameValue + "\" } }";
    }
View Full Code Here

Examples of org.elasticsearch.action.search.type.ParsedScrollId.type()

    }

    @Override protected void doExecute(SearchScrollRequest request, ActionListener<SearchResponse> listener) {
        try {
            ParsedScrollId scrollId = parseScrollId(request.scrollId());
            if (scrollId.type().equals(QUERY_THEN_FETCH_TYPE)) {
                queryThenFetchAction.execute(request, scrollId, listener);
            } else if (scrollId.type().equals(QUERY_AND_FETCH_TYPE)) {
                queryAndFetchAction.execute(request, scrollId, listener);
            } else if (scrollId.type().equals(SCAN)) {
                scanAction.execute(request, scrollId, listener);
View Full Code Here

Examples of org.elasticsearch.action.termvector.TermVectorRequest.type()

    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
        MultiTermVectorsRequest multiTermVectorsRequest = new MultiTermVectorsRequest();
        multiTermVectorsRequest.listenerThreaded(false);
        TermVectorRequest template = new TermVectorRequest();
        template.index(request.param("index"));
        template.type(request.param("type"));
        RestTermVectorAction.readURIParameters(template, request);
        multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids")));
        multiTermVectorsRequest.add(template, RestActions.getRestContent(request));

        client.multiTermVectors(multiTermVectorsRequest, new RestToXContentListener<MultiTermVectorsResponse>(channel));
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.