public class HasParentQueryBuilder extends AbstractQueryBuilder<HasParentQueryBuilder>
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 java.lang.String |
NAME |
static ParseField |
QUERY_NAME_FIELD |
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)
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 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) |
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, 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 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 org.apache.lucene.search.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 HasParentQueryBuilder fromXContent(QueryParseContext parseContext) throws java.io.IOException
java.io.IOException
public java.lang.String getWriteableName()
NamedWriteable
protected boolean doEquals(HasParentQueryBuilder that)
AbstractQueryBuilder
QueryBuilder
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.IOException
protected void extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitBuilder> innerHits)
AbstractQueryBuilder
extractInnerHitBuilders
in class AbstractQueryBuilder<HasParentQueryBuilder>