Class Joiner

java.lang.Object
org.elasticsearch.join.mapper.Joiner

public final class Joiner extends Object
Utility class to help build join queries and aggregations, based on a join_field
  • Method Details

    • getJoiner

      public static Joiner getJoiner(org.elasticsearch.index.query.SearchExecutionContext context)
      Get the Joiner for this context, or null if none is configured
    • getJoiner

      public static Joiner getJoiner(org.elasticsearch.search.aggregations.support.AggregationContext context)
      Get the Joiner for this context, or null if none is configured
    • getJoinField

      public String getJoinField()
      Returns:
      the join field for the index
    • filter

      public org.apache.lucene.search.Query filter(String relationType)
      Returns:
      a filter for documents of a specific join type
    • parentFilter

      public org.apache.lucene.search.Query parentFilter(String childType)
      Returns:
      a filter for parent documents of a specific child type
    • childrenFilter

      public org.apache.lucene.search.Query childrenFilter(String parentType)
      Returns:
      a filter for child documents of a specific parent type
    • childTypeExists

      public boolean childTypeExists(String type)
      Returns:
      true if the child type has been defined for the join field
    • parentTypeExists

      public boolean parentTypeExists(String type)
      Returns:
      true if the parent type has been defined for the join field
    • knownRelation

      public boolean knownRelation(String type)
      Returns:
      true if the type has been defined as either a parent or a child for the join field
    • parentJoinField

      public String parentJoinField(String childType)
      Returns:
      the name of the linked join field for documents of a specific child type
    • childJoinField

      public String childJoinField(String parentType)
      Returns:
      the name of the linked join field for documents of a specific parent type