public class HasParentQueryBuilder extends AbstractQueryBuilder<HasParentQueryBuilder>
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 java.lang.String |
NAME |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
EMPTY_PARAMS
Constructor and Description |
---|
HasParentQueryBuilder(StreamInput in)
Read from a stream.
|
HasParentQueryBuilder(java.lang.String type,
QueryBuilder query,
boolean score) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
doEquals(HasParentQueryBuilder 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<HasParentQueryBuilder> |
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. |
HasParentQueryBuilder |
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.
|
HasParentQueryBuilder |
innerHit(InnerHitBuilder innerHit) |
QueryBuilder |
query()
Returns the query to execute.
|
boolean |
score()
Returns
true if the parent score is mapped into the child documents |
java.lang.String |
type()
Returns the parents type name
|
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, declareStandardFields, equals, getName, hashCode, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQueries, toQuery, toXContent, writeQueries, writeTo
buildAsBytes, buildAsBytes, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
rewriteQuery
isFragment
public static final java.lang.String NAME
public static final boolean DEFAULT_IGNORE_UNMAPPED
public HasParentQueryBuilder(java.lang.String type, QueryBuilder query, boolean score)
public HasParentQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractQueryBuilder<HasParentQueryBuilder>
java.io.IOException
public QueryBuilder query()
public boolean score()
true
if the parent score is mapped into the child documentspublic java.lang.String type()
public InnerHitBuilder innerHit()
public HasParentQueryBuilder innerHit(InnerHitBuilder innerHit)
public HasParentQueryBuilder 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 Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery
in class AbstractQueryBuilder<HasParentQueryBuilder>
java.io.IOException
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent
in class AbstractQueryBuilder<HasParentQueryBuilder>
java.io.IOException
public static java.util.Optional<HasParentQueryBuilder> fromXContent(QueryParseContext parseContext) throws java.io.IOException
java.io.IOException
public java.lang.String getWriteableName()
protected boolean doEquals(HasParentQueryBuilder that)
doEquals
in class AbstractQueryBuilder<HasParentQueryBuilder>
protected int doHashCode()
doHashCode
in class AbstractQueryBuilder<HasParentQueryBuilder>
protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext) throws java.io.IOException
doRewrite
in class AbstractQueryBuilder<HasParentQueryBuilder>
java.io.IOException
protected void extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitContextBuilder> innerHits)
extractInnerHitBuilders
in class AbstractQueryBuilder<HasParentQueryBuilder>