java.lang.Object
org.elasticsearch.action.admin.indices.alias.Alias
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class Alias extends Object implements Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
Represents an alias, to be associated with an index
  • Constructor Details

  • Method Details

    • name

      public String name()
      Returns the alias name
    • name

      public Alias name(String name)
      Modify the alias name only
    • filter

      public String filter()
      Returns the filter associated with the alias
    • filter

      public Alias filter(String filter)
      Associates a filter to the alias
    • filter

      public Alias filter(Map<String,​Object> filter)
      Associates a filter to the alias
    • filter

      public Alias filter(QueryBuilder filterBuilder)
      Associates a filter to the alias
    • routing

      public Alias routing(String routing)
      Associates a routing value to the alias
    • indexRouting

      public String indexRouting()
      Returns the index routing value associated with the alias
    • indexRouting

      public Alias indexRouting(String indexRouting)
      Associates an index routing value to the alias
    • searchRouting

      public String searchRouting()
      Returns the search routing value associated with the alias
    • searchRouting

      public Alias searchRouting(String searchRouting)
      Associates a search routing value to the alias
    • writeIndex

      public Boolean writeIndex()
      Returns:
      the write index flag for the alias
    • writeIndex

      public Alias writeIndex(@Nullable Boolean writeIndex)
      Sets whether an alias is pointing to a write-index
    • isHidden

      public Boolean isHidden()
      Returns:
      whether this alias is hidden or not
    • isHidden

      public Alias isHidden(@Nullable Boolean isHidden)
      Sets whether this alias is hidden
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • fromXContent

      public static Alias fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException
      Parses an alias and returns its parsed representation
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object