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, queryNameEMPTY_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)
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
protected QueryBuilder |
doRewrite(QueryRewriteContext queryShardContext) |
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 java.util.Optional<HasParentQueryBuilder> |
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. |
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,
boolean ignoreUnmapped) |
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, writeTobuildAsBytes, buildAsBytes, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitrewriteQueryisFragmentpublic 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.IOExceptionprotected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo in class AbstractQueryBuilder<HasParentQueryBuilder>java.io.IOExceptionpublic 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, boolean ignoreUnmapped)
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 org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery in class AbstractQueryBuilder<HasParentQueryBuilder>java.io.IOExceptionprotected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent in class AbstractQueryBuilder<HasParentQueryBuilder>java.io.IOExceptionpublic static java.util.Optional<HasParentQueryBuilder> fromXContent(QueryParseContext parseContext) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getWriteableName()
NamedWriteableprotected boolean doEquals(HasParentQueryBuilder that)
AbstractQueryBuilderQueryBuilder object of the same type is "equal to" this one.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.IOExceptionprotected void extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitBuilder> innerHits)
AbstractQueryBuilderextractInnerHitBuilders in class AbstractQueryBuilder<HasParentQueryBuilder>