Package org.elasticsearch.join.query
Class HasParentQueryBuilder
java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<HasParentQueryBuilder>
org.elasticsearch.join.query.HasParentQueryBuilder
- All Implemented Interfaces:
NamedWriteable
,Writeable
,QueryBuilder
,Rewriteable<QueryBuilder>
,org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentObject
Builder for the 'has_parent' query.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V extends Object>, Writeable.Writer<V extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
The default value for ignore_unmapped.static final String
Fields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionHasParentQueryBuilder
(String type, QueryBuilder query, boolean score) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected int
protected QueryBuilder
doRewrite
(QueryRewriteContext queryRewriteContext) protected org.apache.lucene.search.Query
doToQuery
(SearchExecutionContext context) protected void
doWriteTo
(StreamOutput out) protected void
doXContent
(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) protected void
extractInnerHitBuilders
(Map<String, InnerHitContextBuilder> innerHits) static HasParentQueryBuilder
fromXContent
(org.elasticsearch.xcontent.XContentParser parser) boolean
Gets whether the query builder will ignore unmapped types (and run aMatchNoDocsQuery
in place of this query) or throw an exception if the type is unmapped.ignoreUnmapped
(boolean ignoreUnmapped) Sets whether the query builder should ignore unmapped types (and run aMatchNoDocsQuery
in place of this query) or throw an exception if the type is unmapped.innerHit()
Returns inner hit definition in the scope of this query and reusing the defined type and query.innerHit
(InnerHitBuilder innerHit) query()
Returns the query to execute.boolean
score()
Returnstrue
if the parent score is mapped into the child documentstype()
Returns the parents type nameMethods inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, checkNegativeBoost, declareStandardFields, equals, getName, hashCode, parseInnerQueryBuilder, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
-
DEFAULT_IGNORE_UNMAPPED
public static final boolean DEFAULT_IGNORE_UNMAPPEDThe default value for ignore_unmapped.- See Also:
-
-
Constructor Details
-
HasParentQueryBuilder
-
HasParentQueryBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classAbstractQueryBuilder<HasParentQueryBuilder>
- Throws:
IOException
-
query
Returns the query to execute. -
score
public boolean score()Returnstrue
if the parent score is mapped into the child documents -
type
Returns the parents type name -
innerHit
Returns inner hit definition in the scope of this query and reusing the defined type and query. -
innerHit
-
ignoreUnmapped
Sets whether the query builder should ignore unmapped types (and run aMatchNoDocsQuery
in place of this query) or throw an exception if the type is unmapped. -
ignoreUnmapped
public boolean ignoreUnmapped()Gets whether the query builder will ignore unmapped types (and run aMatchNoDocsQuery
in place of this query) or throw an exception if the type is unmapped. -
doToQuery
protected org.apache.lucene.search.Query doToQuery(SearchExecutionContext context) throws IOException - Specified by:
doToQuery
in classAbstractQueryBuilder<HasParentQueryBuilder>
- Throws:
IOException
-
doXContent
protected void doXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
doXContent
in classAbstractQueryBuilder<HasParentQueryBuilder>
- Throws:
IOException
-
fromXContent
public static HasParentQueryBuilder fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
getWriteableName
-
doEquals
- Specified by:
doEquals
in classAbstractQueryBuilder<HasParentQueryBuilder>
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classAbstractQueryBuilder<HasParentQueryBuilder>
-
doRewrite
- Overrides:
doRewrite
in classAbstractQueryBuilder<HasParentQueryBuilder>
- Throws:
IOException
-
extractInnerHitBuilders
- Overrides:
extractInnerHitBuilders
in classAbstractQueryBuilder<HasParentQueryBuilder>
-