Examples of mappings()


Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mappings()

                            channel.sendResponse(new XContentThrowableRestResponse(request, new IndexMissingException(new Index(indices[0]))));
                            return;
                        }
                        boolean foundType = false;
                        IndexMetaData indexMetaData = metaData.iterator().next();
                        for (MappingMetaData mappingMd : indexMetaData.mappings().values()) {
                            if (!types.isEmpty() && !types.contains(mappingMd.type())) {
                                // filter this type out...
                                continue;
                            }
                            foundType = true;
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mappings()

                        }
                    } else {
                        for (IndexMetaData indexMetaData : metaData) {
                            builder.startObject(indexMetaData.index());

                            for (MappingMetaData mappingMd : indexMetaData.mappings().values()) {
                                if (!types.isEmpty() && !types.contains(mappingMd.type())) {
                                    // filter this type out...
                                    continue;
                                }
                                byte[] mappingSource = mappingMd.source().uncompressed();
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mappings()

        }

        if (request.filteredIndices() != null && request.filteredIndices().length == 1 && typesSet.size() == 1) {
            boolean foundType = false;
            IndexMetaData indexMetaData = metaData.iterator().next();
            for (MappingMetaData mappingMd : indexMetaData.mappings().values()) {
                if (!typesSet.isEmpty() && !typesSet.contains(mappingMd.type())) {
                    // filter this type out...
                    continue;
                }
                foundType = true;
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mappings()

            }
        } else {
            for (IndexMetaData indexMetaData : metaData) {
                builder.startObject(indexMetaData.index(), XContentBuilder.FieldCaseConversion.NONE);

                for (MappingMetaData mappingMd : indexMetaData.mappings().values()) {
                    if (!typesSet.isEmpty() && !typesSet.contains(mappingMd.type())) {
                        // filter this type out...
                        continue;
                    }
                    builder.field(mappingMd.type());
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mappings()

                IndexMetaData indexData = client.admin().cluster().state(new ClusterStateRequest()).
                        actionGet().getState().metaData().indices().get(searchIndexName);
                Settings searchIndexSettings = indexData.settings();

                for(ObjectCursor<String> mapKeyCursor : indexData.mappings().keys()) {
                    reindexAction.handleRequest(request, channel, mapKeyCursor.value, true);
                }
            }
            else {
                reindexAction.handleRequest(request, channel, type, true);
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mappings()

           
        CreateIndexRequest createReq;
       
        if(type.equals("*")) {
            createReq = new CreateIndexRequest(newIndex);
            for(ObjectObjectCursor<String, MappingMetaData> mapCursor : indexData.mappings()) {
                createReq.mapping(mapCursor.key, mapCursor.value.sourceAsMap());
            }
            createReq.settings(settingBuilder.build());
        }
        else {
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexMetaData.mappings()

        MetaData metaData = response.getState().metaData();
        XContentBuilder builder = XContentFactory.jsonBuilder().startObject();

        IndexMetaData indexMetaData = metaData.iterator().next();
        for (ObjectCursor<MappingMetaData> cursor: indexMetaData.mappings().values()) {
            builder.field(cursor.value.type());
            builder.map(cursor.value.sourceAsMap());
        }
        builder.endObject();
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexTemplateMetaData.mappings()

                .prepareGetTemplates(".partitioned.partitioned.").execute().actionGet();

        assertThat(response.getIndexTemplates().size(), is(1));
        IndexTemplateMetaData templateMeta = response.getIndexTemplates().get(0);
        assertThat(templateMeta.getName(), is(".partitioned.partitioned."));
        assertThat(templateMeta.mappings().get(Constants.DEFAULT_MAPPING_TYPE).string(),
                is("{\"default\":" +
                        "{\"properties\":{" +
                        "\"id\":{\"type\":\"integer\",\"store\":false,\"index\":\"not_analyzed\",\"doc_values\":true}," +
                        "\"name\":{\"type\":\"string\",\"store\":false,\"index\":\"not_analyzed\",\"doc_values\":true}," +
                        "\"names\":{\"type\":\"string\",\"store\":false,\"index\":\"not_analyzed\",\"doc_values\":false}" +
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexTemplateMetaData.mappings()

        execute("alter table t partition (date='2014-01-01') add name string");

        GetIndexTemplatesResponse templatesResponse = client().admin().indices().getTemplates(new GetIndexTemplatesRequest(".partitioned.t.")).actionGet();
        IndexTemplateMetaData metaData = templatesResponse.getIndexTemplates().get(0);
        String mappingSource = metaData.mappings().get(Constants.DEFAULT_MAPPING_TYPE).toString();
        Map mapping = (Map) XContentFactory.xContent(mappingSource)
                .createParser(mappingSource)
                .mapAndClose()
                .get(Constants.DEFAULT_MAPPING_TYPE);
        assertNull(((Map) mapping.get("properties")).get("name"));
View Full Code Here

Examples of org.elasticsearch.cluster.metadata.IndexTemplateMetaData.mappings()

        execute("select * from t");
        assertThat(Arrays.asList(response.cols()), Matchers.contains("date", "id", "name", "name2"));

        templatesResponse = client().admin().indices().getTemplates(new GetIndexTemplatesRequest(".partitioned.t.")).actionGet();
        metaData = templatesResponse.getIndexTemplates().get(0);
        mappingSource = metaData.mappings().get(Constants.DEFAULT_MAPPING_TYPE).toString();
        mapping = (Map) XContentFactory.xContent(mappingSource)
                .createParser(mappingSource)
                .mapAndClose().get(Constants.DEFAULT_MAPPING_TYPE);
        assertNotNull(((Map) mapping.get("properties")).get("name2"));
    }
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.