org.elasticsearch.common.io.stream.NamedWriteable
, org.elasticsearch.common.io.stream.Writeable
, org.elasticsearch.common.xcontent.ToXContent
, org.elasticsearch.common.xcontent.ToXContentObject
, org.elasticsearch.index.query.QueryBuilder
, org.elasticsearch.index.query.Rewriteable<org.elasticsearch.index.query.QueryBuilder>
public class HasChildQueryBuilder extends org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>
Modifier and Type | Class | Description |
---|---|---|
static class |
HasChildQueryBuilder.LateParsingQuery |
A query that rewrites into another query using
JoinUtil.createJoinQuery(String, Query, Query, IndexSearcher, ScoreMode, OrdinalMap, int, int)
that executes the actual join. |
Modifier and Type | Field | 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 |
Constructor | Description |
---|---|
HasChildQueryBuilder(java.lang.String type,
org.elasticsearch.index.query.QueryBuilder query,
org.apache.lucene.search.join.ScoreMode scoreMode) |
|
HasChildQueryBuilder(org.elasticsearch.common.io.stream.StreamInput in) |
Read from a stream.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
childType() |
Returns the child type
|
protected boolean |
doEquals(HasChildQueryBuilder that) |
|
protected int |
doHashCode() |
|
protected org.elasticsearch.index.query.QueryBuilder |
doRewrite(org.elasticsearch.index.query.QueryRewriteContext queryShardContext) |
|
protected org.apache.lucene.search.Query |
doToQuery(org.elasticsearch.index.query.QueryShardContext context) |
|
protected void |
doWriteTo(org.elasticsearch.common.io.stream.StreamOutput out) |
|
protected void |
doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder,
org.elasticsearch.common.xcontent.ToXContent.Params params) |
|
protected void |
extractInnerHitBuilders(java.util.Map<java.lang.String,org.elasticsearch.index.query.InnerHitContextBuilder> innerHits) |
|
static HasChildQueryBuilder |
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) |
|
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. |
org.elasticsearch.index.query.InnerHitBuilder |
innerHit() |
Returns inner hit definition in the scope of this query and reusing the defined type and query.
|
HasChildQueryBuilder |
innerHit(org.elasticsearch.index.query.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.
|
org.elasticsearch.index.query.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, declareStandardFields, equals, getName, hashCode, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQuery, toString, toXContent, writeTo
public 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, org.elasticsearch.index.query.QueryBuilder query, org.apache.lucene.search.join.ScoreMode scoreMode)
public HasChildQueryBuilder(org.elasticsearch.common.io.stream.StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(org.elasticsearch.common.io.stream.StreamOutput out) throws java.io.IOException
doWriteTo
in class org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>
java.io.IOException
public HasChildQueryBuilder minMaxChildren(int minChildren, int maxChildren)
public org.elasticsearch.index.query.InnerHitBuilder innerHit()
public HasChildQueryBuilder innerHit(org.elasticsearch.index.query.InnerHitBuilder innerHit)
public org.elasticsearch.index.query.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(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
doXContent
in class org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>
java.io.IOException
public static HasChildQueryBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
java.io.IOException
public java.lang.String getWriteableName()
protected org.apache.lucene.search.Query doToQuery(org.elasticsearch.index.query.QueryShardContext context) throws java.io.IOException
doToQuery
in class org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>
java.io.IOException
protected boolean doEquals(HasChildQueryBuilder that)
doEquals
in class org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>
protected int doHashCode()
doHashCode
in class org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>
protected org.elasticsearch.index.query.QueryBuilder doRewrite(org.elasticsearch.index.query.QueryRewriteContext queryShardContext) throws java.io.IOException
doRewrite
in class org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>
java.io.IOException
protected void extractInnerHitBuilders(java.util.Map<java.lang.String,org.elasticsearch.index.query.InnerHitContextBuilder> innerHits)
extractInnerHitBuilders
in class org.elasticsearch.index.query.AbstractQueryBuilder<HasChildQueryBuilder>