How do I find the alias for an index in ElasticSearch -


I want to find an alias for a given index in ElasticSearch. In fact, the opposite of this question:

How did I do this? Map

  // [alias = & gt; [Index = & gt; Metadata, ...], ...] ImmutableOpenMap & lt; String, Imitable Openmark & ​​lt; String, alloyetadata & gt; & Gt; AliasesAndIndices = client.admin (). Cluster () .prepareState () carry about (). ActionGet (). GetState () .getMetaData (). GetAliases (); Maps & lt; String, string & gt; AliasForIndex = New Hashmap & lt; & Gt; (); // it is indexed to index = & gt; Change in a map of Nickname, ...] (string aliases: aliases and indeces.quote (). ToArray (string.class)) {imputable openmark & ​​lt; String, alloyetadata & gt; Interiormap = alias and india.gate (alias); (String Index: Innermark. Keys) ToArray (string class)) {aliasForIndex.put (index, alias); }}   

And then I could get the nickname for an index like this.

  aliasForIndex.get (index)    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -