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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String[]Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionEnrichPolicy(String type, EnrichPolicy.QuerySource query, List<String> indices, String matchField, List<String> enrichFields) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic EnrichPolicyfromXContent(org.elasticsearch.xcontent.XContentParser parser) static StringgetBaseName(String policyName) static StringgetIndexName(String policyName, long nowTimestamp) Given a policy name and a timestamp, return the enrich index name that should be used.getQuery()getType()inthashCode()static booleanisPolicyForIndex(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.toString()org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
ENRICH_INDEX_NAME_BASE
- See Also:
-
ENRICH_INDEX_PATTERN
- See Also:
-
MATCH_TYPE
- See Also:
-
GEO_MATCH_TYPE
- See Also:
-
RANGE_TYPE
- See Also:
-
SUPPORTED_POLICY_TYPES
-
-
Constructor Details
-
EnrichPolicy
- Throws:
IOException
-
EnrichPolicy
-
-
Method Details
-
fromXContent
public static EnrichPolicy fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
getType
-
getQuery
-
getIndices
-
getMatchField
-
getEnrichFields
-
getBaseName
-
getIndexName
Given a policy name and a timestamp, return the enrich index name that should be used.- Parameters:
policyName- the name of the policynowTimestamp- the current time- Returns:
- an enrich index name
-
isPolicyForIndex
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 nameindexName- the index name- Returns:
- true if and only if the named policy is associated with the named index
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-