Package org.elasticsearch.action.admin.indices.alias

Examples of org.elasticsearch.action.admin.indices.alias.Alias


                "      }\n" +
                "    }\n" +
                "  }\n" +
                "}";

        assertAcked(prepareCreate("test").addAlias(new Alias("alias")).setSource(createIndexSource));
        ensureGreen();
        String doc = "{\n" +
                "  \"murmur\": \"Some value that can be hashed\",\n" +
                "  \"token_count\": \"A text with five words.\",\n" +
                "  \"text\": \"A text with five words.\"\n" +
View Full Code Here


public class GetIndexBackwardsCompatibilityTests extends ElasticsearchBackwardsCompatIntegrationTest {

    @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());
View Full Code Here

                        //handle aliases
                        for (ObjectObjectCursor<String, AliasMetaData> cursor : template.aliases()) {
                            AliasMetaData aliasMetaData = cursor.value;
                            //if an alias with same name came with the create index request itself,
                            // ignore this one taken from the index template
                            if (request.aliases().contains(new Alias(aliasMetaData.alias()))) {
                                continue;
                            }
                            //if an alias with same name was already processed, ignore this one
                            if (templatesAliases.containsKey(cursor.key)) {
                                continue;
View Full Code Here

            client().admin().indices().prepareDelete("test1").execute().actionGet();
        } catch (Exception e) {
            // ignore
        }
        logger.info("--> creating index test");
        client().admin().indices().create(createIndexRequest("test1").alias(new Alias("test"))).actionGet();
    }
View Full Code Here

public class BulkTests extends ElasticsearchIntegrationTest {

    @Test
    public void testBulkUpdate_simple() throws Exception {
        assertAcked(prepareCreate("test").addAlias(new Alias("alias")));
        ensureGreen();

        BulkResponse bulkResponse = client().prepareBulk()
                .add(client().prepareIndex().setIndex(indexOrAlias()).setType("type1").setId("1").setSource("field", 1))
                .add(client().prepareIndex().setIndex(indexOrAlias()).setType("type1").setId("2").setSource("field", 2).setCreate(true))
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.alias.Alias

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.