Package org.elasticsearch.join.mapper
Class Joiner
java.lang.Object
org.elasticsearch.join.mapper.Joiner
public final class Joiner
extends java.lang.Object
Utility class to help build join queries and aggregations, based on a join_field
-
Method Summary
Modifier and Type Method Description java.lang.String
childJoinField(java.lang.String parentType)
org.apache.lucene.search.Query
childrenFilter(java.lang.String parentType)
boolean
childTypeExists(java.lang.String type)
org.apache.lucene.search.Query
filter(java.lang.String relationType)
static Joiner
getJoiner(org.elasticsearch.index.query.SearchExecutionContext context)
Get the Joiner for this context, ornull
if none is configuredstatic Joiner
getJoiner(org.elasticsearch.search.aggregations.support.AggregationContext context)
Get the Joiner for this context, ornull
if none is configuredjava.lang.String
getJoinField()
boolean
knownRelation(java.lang.String type)
org.apache.lucene.search.Query
parentFilter(java.lang.String childType)
java.lang.String
parentJoinField(java.lang.String childType)
boolean
parentTypeExists(java.lang.String type)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
getJoiner
Get the Joiner for this context, ornull
if none is configured -
getJoiner
public static Joiner getJoiner(org.elasticsearch.search.aggregations.support.AggregationContext context)Get the Joiner for this context, ornull
if none is configured -
getJoinField
public java.lang.String getJoinField()- Returns:
- the join field for the index
-
filter
public org.apache.lucene.search.Query filter(java.lang.String relationType)- Returns:
- a filter for documents of a specific join type
-
parentFilter
public org.apache.lucene.search.Query parentFilter(java.lang.String childType)- Returns:
- a filter for parent documents of a specific child type
-
childrenFilter
public org.apache.lucene.search.Query childrenFilter(java.lang.String parentType)- Returns:
- a filter for child documents of a specific parent type
-
childTypeExists
public boolean childTypeExists(java.lang.String type)- Returns:
true
if the child type has been defined for the join field
-
parentTypeExists
public boolean parentTypeExists(java.lang.String type)- Returns:
true
if the parent type has been defined for the join field
-
knownRelation
public boolean knownRelation(java.lang.String type)- Returns:
true
if the type has been defined as either a parent or a child for the join field
-
parentJoinField
public java.lang.String parentJoinField(java.lang.String childType)- Returns:
- the name of the linked join field for documents of a specific child type
-
childJoinField
public java.lang.String childJoinField(java.lang.String parentType)- Returns:
- the name of the linked join field for documents of a specific parent type
-