Package org.elasticsearch.action.admin.indices.get

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


        internalCluster().startNode(ImmutableSettings.builder()
                .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


    @Test
    public void testGetAliases() throws Exception {
        CreateIndexResponse createIndexResponse = prepareCreate("test").addAlias(new Alias("testAlias")).execute().actionGet();
        assertAcked(createIndexResponse);
        GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().addIndices("test").addFeatures("_aliases")
                .execute().actionGet();
        ImmutableOpenMap<String, ImmutableList<AliasMetaData>> aliasesMap = getIndexResponse.aliases();
        assertThat(aliasesMap, notNullValue());
        assertThat(aliasesMap.size(), equalTo(1));
        ImmutableList<AliasMetaData> aliasesList = aliasesMap.get("test");
        assertThat(aliasesList, notNullValue());
        assertThat(aliasesList.size(), equalTo(1));
View Full Code Here

    @Test
    public void testGetMappings() throws Exception {
        CreateIndexResponse createIndexResponse = prepareCreate("test").addMapping("type1", "{\"type1\":{}}").execute().actionGet();
        assertAcked(createIndexResponse);
        GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().addIndices("test").addFeatures("_mappings")
                .execute().actionGet();
        ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappings = getIndexResponse.mappings();
        assertThat(mappings, notNullValue());
        assertThat(mappings.size(), equalTo(1));
        ImmutableOpenMap<String, MappingMetaData> indexMappings = mappings.get("test");
        assertThat(indexMappings, notNullValue());
        assertThat(indexMappings.size(), anyOf(equalTo(1), equalTo(2)));
View Full Code Here

    @Test
    public void testGetSettings() throws Exception {
        CreateIndexResponse createIndexResponse = prepareCreate("test").setSettings(ImmutableSettings.builder().put("number_of_shards", 1)).execute().actionGet();
        assertAcked(createIndexResponse);
        GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().addIndices("test").addFeatures("_settings")
                .execute().actionGet();
        ImmutableOpenMap<String, Settings> settingsMap = getIndexResponse.settings();
        assertThat(settingsMap, notNullValue());
        assertThat(settingsMap.size(), equalTo(1));
        Settings settings = settingsMap.get("test");
        assertThat(settings, notNullValue());
        assertThat(settings.get("index.number_of_shards"), equalTo("1"));
View Full Code Here

    public void testGetWarmers() throws Exception {
        createIndex("test");
        ensureSearchable("test");
        assertAcked(client().admin().indices().preparePutWarmer("warmer1").setSearchRequest(client().prepareSearch("test")).get());
        ensureSearchable("test");
        GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().addIndices("test").addFeatures("_warmers")
                .execute().actionGet();
        ImmutableOpenMap<String, ImmutableList<Entry>> warmersMap = getIndexResponse.warmers();
        assertThat(warmersMap, notNullValue());
        assertThat(warmersMap.size(), equalTo(1));
        ImmutableList<Entry> warmersList = warmersMap.get("test");
        assertThat(warmersList, notNullValue());
        assertThat(warmersList.size(), equalTo(1));
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.get.GetIndexResponse

Copyright © 2018 www.massapicom. 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.