public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuilder>
Writeable.Reader<R>
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
The queries name
|
static ParseField |
QUERY_NAME_FIELD |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
EMPTY_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)
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
protected QueryBuilder |
doRewrite(QueryRewriteContext queryRewriteContext) |
protected org.apache.lucene.search.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,InnerHitBuilder> innerHits)
For internal usage only!
Extracts the inner hits from the query tree.
|
static HasChildQueryBuilder |
fromXContent(QueryParseContext parseContext) |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
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.
|
static org.apache.lucene.search.join.ScoreMode |
parseScoreMode(java.lang.String scoreModeString) |
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.
|
static java.lang.String |
scoreModeAsString(org.apache.lucene.search.join.ScoreMode scoreMode) |
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, equals, getName, hashCode, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, toFilter, toQueries, toQuery, toXContent, writeQueries, writeTo
buildAsBytes, buildAsBytes, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
rewriteQuery
public static final java.lang.String NAME
public static final ParseField QUERY_NAME_FIELD
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.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractQueryBuilder<HasChildQueryBuilder>
java.io.IOException
public 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.IOException
public static HasChildQueryBuilder fromXContent(QueryParseContext parseContext) throws java.io.IOException
java.io.IOException
public static org.apache.lucene.search.join.ScoreMode parseScoreMode(java.lang.String scoreModeString)
public static java.lang.String scoreModeAsString(org.apache.lucene.search.join.ScoreMode scoreMode)
public java.lang.String getWriteableName()
NamedWriteable
protected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery
in class AbstractQueryBuilder<HasChildQueryBuilder>
java.io.IOException
protected boolean doEquals(HasChildQueryBuilder that)
AbstractQueryBuilder
QueryBuilder
object of the same type is "equal to" this one.doEquals
in class AbstractQueryBuilder<HasChildQueryBuilder>
protected int doHashCode()
doHashCode
in class AbstractQueryBuilder<HasChildQueryBuilder>
protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws java.io.IOException
doRewrite
in class AbstractQueryBuilder<HasChildQueryBuilder>
java.io.IOException
protected void extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitBuilder> innerHits)
AbstractQueryBuilder
extractInnerHitBuilders
in class AbstractQueryBuilder<HasChildQueryBuilder>