Examples of indices()


Examples of org.elasticsearch.action.admin.indices.get.GetIndexResponse.indices()

                .put(baseSettings)
                .put(InternalNode.HTTP_ENABLED, true)
                .build());
        ensureYellow("test");
        GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().get();
        assertArrayEquals(new String[] {"test"}, getIndexResponse.indices());
        GetSettingsResponse getSettingsResponse = client().admin().indices().prepareGetSettings("test").get();
        assertEquals(expectedHashFunction.getName(), getSettingsResponse.getSetting("test", IndexMetaData.SETTING_LEGACY_ROUTING_HASH_FUNCTION));
        assertEquals(Boolean.valueOf(expectedUseType).toString(), getSettingsResponse.getSetting("test", IndexMetaData.SETTING_LEGACY_ROUTING_USE_TYPE));
        SearchResponse allDocs = client().prepareSearch("test").get();
        assertSearchResponse(allDocs);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRequest.indices()

    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
        final String[] types = request.paramAsStringArrayOrEmptyIfAll("type");
        final String[] fields = Strings.splitStringByCommaToArray(request.param("fields"));
        GetFieldMappingsRequest getMappingsRequest = new GetFieldMappingsRequest();
        getMappingsRequest.indices(indices).types(types).fields(fields).includeDefaults(request.paramAsBoolean("include_defaults", false));
        getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions()));
        getMappingsRequest.local(request.paramAsBoolean("local", getMappingsRequest.local()));
        client.admin().indices().getFieldMappings(getMappingsRequest, new RestBuilderListener<GetFieldMappingsResponse>(channel) {

            @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest.indices()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
        final String[] types = request.paramAsStringArrayOrEmptyIfAll("type");
        GetMappingsRequest getMappingsRequest = new GetMappingsRequest();
        getMappingsRequest.indices(indices).types(types);
        getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions()));
        getMappingsRequest.local(request.paramAsBoolean("local", getMappingsRequest.local()));
        client.admin().indices().getMappings(getMappingsRequest, new RestBuilderListener<GetMappingsResponse>(channel) {
            @Override
            public RestResponse buildResponse(GetMappingsResponse response, XContentBuilder builder) throws Exception {
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest.indices()

        // need to merge the _meta part of the mapping mapping before-hand because ES doesn't
        // update the _meta column recursively. Instead it is overwritten and therefore partitioned by
        // and collection_type information would be lost.
        String[] indexNames = getIndexNames(analysis.table(), analysis.partitionName().orNull());
        PutMappingRequest request = new PutMappingRequest();
        request.indices(indexNames);
        request.type(Constants.DEFAULT_MAPPING_TYPE);
        IndexMetaData indexMetaData = clusterService.state().getMetaData().getIndices().get(indexNames[0]);
        try {
            Map mergedMeta = (Map)indexMetaData.getMappings()
                    .get(Constants.DEFAULT_MAPPING_TYPE)
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequest.indices()

    List<RefreshRequest> requests = refreshAction.call();
    assertThat(requests).hasSize(1);

    RefreshRequest request = requests.get(0);
    assertThat(request.indices()).containsOnly(TEST_INDEX.getIndexName());
    assertThat(request.force()).isFalse();
  }
}
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest.indices()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
        indicesStatsRequest.listenerThreaded(false);
        indicesStatsRequest.indicesOptions(IndicesOptions.fromRequest(request, indicesStatsRequest.indicesOptions()));
        indicesStatsRequest.indices(Strings.splitStringByCommaToArray(request.param("index")));
        indicesStatsRequest.types(Strings.splitStringByCommaToArray(request.param("types")));

        Set<String> metrics = Strings.splitStringByCommaToSet(request.param("metric", "_all"));
        // short cut, if no metrics have been specified in URI
        if (metrics.size() == 1 && metrics.contains("_all")) {
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.warmer.get.GetWarmersRequest.indices()

        final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
        final String[] types = Strings.splitStringByCommaToArray(request.param("type"));
        final String[] names = request.paramAsStringArray("name", Strings.EMPTY_ARRAY);

        GetWarmersRequest getWarmersRequest = new GetWarmersRequest();
        getWarmersRequest.indices(indices).types(types).warmers(names);
        getWarmersRequest.local(request.paramAsBoolean("local", getWarmersRequest.local()));
        getWarmersRequest.indicesOptions(IndicesOptions.fromRequest(request, getWarmersRequest.indicesOptions()));
        client.admin().indices().getWarmers(getWarmersRequest, new RestBuilderListener<GetWarmersResponse>(channel) {

            @Override
View Full Code Here

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

    public void start() {
        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) {
View Full Code Here

Examples of org.elasticsearch.action.percolate.MultiPercolateRequest.indices()

    @Override
    public void handleRequest(final RestRequest restRequest, final RestChannel restChannel, final Client client) throws Exception {
        MultiPercolateRequest multiPercolateRequest = new MultiPercolateRequest();
        multiPercolateRequest.indicesOptions(IndicesOptions.fromRequest(restRequest, multiPercolateRequest.indicesOptions()));
        multiPercolateRequest.indices(Strings.splitStringByCommaToArray(restRequest.param("index")));
        multiPercolateRequest.documentType(restRequest.param("type"));
        multiPercolateRequest.add(RestActions.getRestContent(restRequest), restRequest.contentUnsafe(), allowExplicitIndex);

        client.multiPercolate(multiPercolateRequest, new RestToXContentListener<MultiPercolateResponse>(restChannel));
    }
View Full Code Here

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
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.