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

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


   */
    private void createAlias(String alias, String index) throws Exception {
    if (logger.isTraceEnabled()) logger.trace("createAlias("+alias+","+index+")");
    checkClient();
   
    IndicesAliasesResponse response = client.admin().indices().prepareAliases().addAlias(index, alias).execute().actionGet();
    if (!response.isAcknowledged()) throw new Exception("Could not define alias [" + alias + "] for index [" + index + "].");
    if (logger.isTraceEnabled()) logger.trace("/createAlias("+alias+","+index+")");
  }
View Full Code Here


    @Test
    public void testIndicesAliasesNoAcknowledgement() {
        createIndex("test");

        IndicesAliasesResponse indicesAliasesResponse = client().admin().indices().prepareAliases().addAlias("test", "alias").setTimeout("0s").get();
        assertThat(indicesAliasesResponse.isAcknowledged(), equalTo(false));
    }
View Full Code Here

TOP

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

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.