public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuilder>
| Modifier and Type | Class and Description |
|---|---|
static class |
HasChildQueryBuilder.LateParsingQuery
A query that rewrites into another query using
JoinUtil.createJoinQuery(String, Query, Query, IndexSearcher, ScoreMode, MultiDocValues.OrdinalMap, int, int)
that executes the actual join. |
Writeable.Reader<V>, Writeable.Writer<V>ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_IGNORE_UNMAPPED
The default value for ignore_unmapped.
|
static int |
DEFAULT_MAX_CHILDREN
The default maximum number of children that are required to match for the parent to be considered a match.
|
static int |
DEFAULT_MIN_CHILDREN
The default minimum number of children that are required to match for the parent to be considered a match.
|
static java.lang.String |
NAME |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryNameEMPTY_PARAMS| Constructor and Description |
|---|
HasChildQueryBuilder(StreamInput in)
Read from a stream.
|
HasChildQueryBuilder(java.lang.String type,
QueryBuilder query,
org.apache.lucene.search.join.ScoreMode scoreMode) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
childType()
Returns the child type
|
protected boolean |
doEquals(HasChildQueryBuilder that) |
protected int |
doHashCode() |
protected QueryBuilder |
doRewrite(QueryRewriteContext queryShardContext) |
protected Query |
doToQuery(QueryShardContext context) |
protected void |
doWriteTo(StreamOutput out) |
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
protected void |
extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitContextBuilder> innerHits) |
static java.util.Optional<HasChildQueryBuilder> |
fromXContent(QueryParseContext parseContext) |
java.lang.String |
getWriteableName() |
boolean |
ignoreUnmapped()
Gets whether the query builder will ignore unmapped types (and run a
MatchNoDocsQuery in place of this query) or throw an exception if
the type is unmapped. |
HasChildQueryBuilder |
ignoreUnmapped(boolean ignoreUnmapped)
Sets whether the query builder should ignore unmapped types (and run a
MatchNoDocsQuery in place of this query) or throw an exception if
the type is unmapped. |
InnerHitBuilder |
innerHit()
Returns inner hit definition in the scope of this query and reusing the defined type and query.
|
HasChildQueryBuilder |
innerHit(InnerHitBuilder innerHit) |
int |
maxChildren()
Returns the maximum number of children that are required to match for the parent to be considered a match.
|
int |
minChildren()
Returns the minimum number of children that are required to match for the parent to be considered a match.
|
HasChildQueryBuilder |
minMaxChildren(int minChildren,
int maxChildren)
Defines the minimum number of children that are required to match for the parent to be considered a match and
the maximum number of children that are required to match for the parent to be considered a match.
|
QueryBuilder |
query()
Returns the children query to execute.
|
org.apache.lucene.search.join.ScoreMode |
scoreMode()
Returns how the scores from the matching child documents are mapped into the parent document.
|
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, declareStandardFields, equals, getName, hashCode, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQueries, toQuery, toXContent, writeQueries, writeTobuildAsBytes, buildAsBytes, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitrewriteQueryisFragmentpublic static final java.lang.String NAME
public static final int DEFAULT_MAX_CHILDREN
public static final int DEFAULT_MIN_CHILDREN
public static final boolean DEFAULT_IGNORE_UNMAPPED
public HasChildQueryBuilder(java.lang.String type,
QueryBuilder query,
org.apache.lucene.search.join.ScoreMode scoreMode)
public HasChildQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionprotected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo in class AbstractQueryBuilder<HasChildQueryBuilder>java.io.IOExceptionpublic HasChildQueryBuilder minMaxChildren(int minChildren, int maxChildren)
public InnerHitBuilder innerHit()
public HasChildQueryBuilder innerHit(InnerHitBuilder innerHit)
public QueryBuilder query()
public java.lang.String childType()
public org.apache.lucene.search.join.ScoreMode scoreMode()
public int minChildren()
public int maxChildren()
public HasChildQueryBuilder ignoreUnmapped(boolean ignoreUnmapped)
MatchNoDocsQuery in place of this query) or throw an exception if
the type is unmapped.public boolean ignoreUnmapped()
MatchNoDocsQuery in place of this query) or throw an exception if
the type is unmapped.protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent in class AbstractQueryBuilder<HasChildQueryBuilder>java.io.IOExceptionpublic static java.util.Optional<HasChildQueryBuilder> fromXContent(QueryParseContext parseContext) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getWriteableName()
protected Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery in class AbstractQueryBuilder<HasChildQueryBuilder>java.io.IOExceptionprotected boolean doEquals(HasChildQueryBuilder that)
doEquals in class AbstractQueryBuilder<HasChildQueryBuilder>protected int doHashCode()
doHashCode in class AbstractQueryBuilder<HasChildQueryBuilder>protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws java.io.IOException
doRewrite in class AbstractQueryBuilder<HasChildQueryBuilder>java.io.IOExceptionprotected void extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitContextBuilder> innerHits)
extractInnerHitBuilders in class AbstractQueryBuilder<HasChildQueryBuilder>