Class EnrichPolicy

java.lang.Object
org.elasticsearch.xpack.core.enrich.EnrichPolicy
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentFragment

public final class EnrichPolicy extends Object implements Writeable, org.elasticsearch.xcontent.ToXContentFragment
Represents an enrich policy including its configuration.
  • Field Details

  • Constructor Details

  • Method Details

    • fromXContent

      public static EnrichPolicy fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • getType

      public String getType()
    • getQuery

      public EnrichPolicy.QuerySource getQuery()
    • getIndices

      public List<String> getIndices()
    • getMatchField

      public String getMatchField()
    • getEnrichFields

      public List<String> getEnrichFields()
    • getBaseName

      public static String getBaseName(String policyName)
    • getIndexName

      public static String getIndexName(String policyName, long nowTimestamp)
      Given a policy name and a timestamp, return the enrich index name that should be used.
      Parameters:
      policyName - the name of the policy
      nowTimestamp - the current time
      Returns:
      an enrich index name
    • isPolicyForIndex

      public static boolean isPolicyForIndex(String policyName, String indexName)
      Tests whether the named policy is associated with the named index according to the naming pattern that exists between policy names and index names.
      Parameters:
      policyName - the policy name
      indexName - the index name
      Returns:
      true if and only if the named policy is associated with the named index
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object