public boolean aliasExists ( String alias ) { try { final JestResult result = jestClient . execute ( new GetSettings . Builder ( ) . addIndex ( alias ) . build ( ) ) ; return result . isSucceeded ( ) && ! Iterators . contains ( result . getJsonObject ( ) . fieldNames ( ) , alias ) ; } catch ( IOException e ) { throw new ElasticsearchException ( "Couldn't check existence of alias " + alias , e ) ; } }
Check if a given name is an existing alias .