Examples of toXContent()


Examples of org.elasticsearch.common.settings.Settings.toXContent()

                builder.startObject("settings");
                Settings settings = templateMetaData.settings();
                if (settingsFilter != null) {
                    settings = settingsFilter.filterSettings(settings);
                }
                settings.toXContent(builder, params);
                builder.endObject();

                builder.startObject("mappings");
                for (ObjectObjectCursor<String, CompressedString> cursor1 : templateMetaData.mappings()) {
                    byte[] mappingSource = cursor1.value.uncompressed();
View Full Code Here

Examples of org.elasticsearch.common.settings.Settings.toXContent()

                builder.startObject("settings");
                Settings settings = indexMetaData.settings();
                if (settingsFilter != null) {
                    settings = settingsFilter.filterSettings(settings);
                }
                settings.toXContent(builder, params);
                builder.endObject();

                builder.startObject("mappings");
                for (ObjectObjectCursor<String, MappingMetaData> cursor : indexMetaData.mappings()) {
                    byte[] mappingSource = cursor.value.source().uncompressed();
View Full Code Here

Examples of org.elasticsearch.common.settings.Settings.toXContent()


            if (nodeInfo.getSettings() != null) {
                builder.startObject("settings");
                Settings settings = settingsFilter != null ? settingsFilter.filterSettings(nodeInfo.getSettings()) : nodeInfo.getSettings();
                settings.toXContent(builder, params);
                builder.endObject();
            }

            if (nodeInfo.getOs() != null) {
                nodeInfo.getOs().toXContent(builder, params);
View Full Code Here

Examples of org.elasticsearch.index.mapper.core.CompletionFieldMapper.toXContent()

        FieldMapper fieldMapper = defaultMapper.mappers().name("completion").mapper();
        assertThat(fieldMapper, instanceOf(CompletionFieldMapper.class));

        CompletionFieldMapper completionFieldMapper = (CompletionFieldMapper) fieldMapper;
        XContentBuilder builder = jsonBuilder().startObject();
        completionFieldMapper.toXContent(builder, null).endObject();
        builder.close();
        Map<String, Object> serializedMap = JsonXContent.jsonXContent.createParser(builder.bytes()).mapAndClose();
        Map<String, Object> configMap = (Map<String, Object>) serializedMap.get("completion");
        assertThat(configMap.get("index_analyzer").toString(), is("simple"));
        assertThat(configMap.get("search_analyzer").toString(), is("standard"));
View Full Code Here

Examples of org.elasticsearch.index.mapper.core.CompletionFieldMapper.toXContent()

        FieldMapper fieldMapper = defaultMapper.mappers().name("completion").mapper();
        assertThat(fieldMapper, instanceOf(CompletionFieldMapper.class));

        CompletionFieldMapper completionFieldMapper = (CompletionFieldMapper) fieldMapper;
        XContentBuilder builder = jsonBuilder().startObject();
        completionFieldMapper.toXContent(builder, null).endObject();
        builder.close();
        Map<String, Object> serializedMap = JsonXContent.jsonXContent.createParser(builder.bytes()).mapAndClose();
        Map<String, Object> configMap = (Map<String, Object>) serializedMap.get("completion");
        assertThat(configMap.get("analyzer").toString(), is("simple"));
    }
View Full Code Here

Examples of org.elasticsearch.index.mapper.core.StringFieldMapper.toXContent()

        assertThat(fieldMapper, instanceOf(StringFieldMapper.class));

        // Check json serialization
        StringFieldMapper stringFieldMapper = (StringFieldMapper) fieldMapper;
        XContentBuilder builder = jsonBuilder().startObject();
        stringFieldMapper.toXContent(builder, ToXContent.EMPTY_PARAMS).endObject();
        builder.close();
        Map<String, Object> serializedMap = JsonXContent.jsonXContent.createParser(builder.bytes()).mapAndClose();
        Map<String, Object> copyTestMap = (Map<String, Object>) serializedMap.get("copy_test");
        assertThat(copyTestMap.get("type").toString(), is("string"));
        List<String> copyToList = (List<String>) copyTestMap.get("copy_to");
View Full Code Here

Examples of org.elasticsearch.index.merge.MergeStats.toXContent()

                builder.endObject();
            }

            MergeStats mergeStats = indexStatus.mergeStats();
            if (mergeStats != null) {
                mergeStats.toXContent(builder, params);
            }
            RefreshStats refreshStats = indexStatus.refreshStats();
            if (refreshStats != null) {
                refreshStats.toXContent(builder, params);
            }
View Full Code Here

Examples of org.elasticsearch.index.merge.MergeStats.toXContent()

                        builder.endObject();
                    }

                    mergeStats = shardStatus.mergeStats();
                    if (mergeStats != null) {
                        mergeStats.toXContent(builder, params);
                    }

                    refreshStats = shardStatus.refreshStats();
                    if (refreshStats != null) {
                        refreshStats.toXContent(builder, params);
View Full Code Here

Examples of org.elasticsearch.index.refresh.RefreshStats.toXContent()

            if (mergeStats != null) {
                mergeStats.toXContent(builder, params);
            }
            RefreshStats refreshStats = indexStatus.refreshStats();
            if (refreshStats != null) {
                refreshStats.toXContent(builder, params);
            }

            builder.startObject(Fields.SHARDS);
            for (IndexShardStatus indexShardStatus : indexStatus) {
                builder.startArray(Integer.toString(indexShardStatus.shardId().id()));
View Full Code Here

Examples of org.elasticsearch.index.refresh.RefreshStats.toXContent()

                        mergeStats.toXContent(builder, params);
                    }

                    refreshStats = shardStatus.refreshStats();
                    if (refreshStats != null) {
                        refreshStats.toXContent(builder, params);
                    }

                    if (shardStatus.peerRecoveryStatus() != null) {
                        PeerRecoveryStatus peerRecoveryStatus = shardStatus.peerRecoveryStatus();
                        builder.startObject(Fields.PEER_RECOVERY);
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.