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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V extends Object>, Writeable.Writer<V extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default value for ignore_unmapped.static final StringFields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryNameFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionHasParentQueryBuilder(String type, QueryBuilder query, boolean score) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected intprotected QueryBuilderdoRewrite(QueryRewriteContext queryRewriteContext) protected org.apache.lucene.search.QuerydoToQuery(SearchExecutionContext context) protected voiddoWriteTo(StreamOutput out) protected voiddoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) protected voidextractInnerHitBuilders(Map<String, InnerHitContextBuilder> innerHits) static HasParentQueryBuilderfromXContent(org.elasticsearch.xcontent.XContentParser parser) booleanGets whether the query builder will ignore unmapped types (and run aMatchNoDocsQueryin 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 aMatchNoDocsQueryin 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.booleanscore()Returnstrueif 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, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
doWriteToin classAbstractQueryBuilder<HasParentQueryBuilder>- Throws:
IOException
-
query
Returns the query to execute. -
score
public boolean score()Returnstrueif 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 aMatchNoDocsQueryin 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 aMatchNoDocsQueryin 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:
doToQueryin classAbstractQueryBuilder<HasParentQueryBuilder>- Throws:
IOException
-
doXContent
protected void doXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
doXContentin classAbstractQueryBuilder<HasParentQueryBuilder>- Throws:
IOException
-
fromXContent
public static HasParentQueryBuilder fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
getWriteableName
-
doEquals
- Specified by:
doEqualsin classAbstractQueryBuilder<HasParentQueryBuilder>
-
doHashCode
protected int doHashCode()- Specified by:
doHashCodein classAbstractQueryBuilder<HasParentQueryBuilder>
-
doRewrite
- Overrides:
doRewritein classAbstractQueryBuilder<HasParentQueryBuilder>- Throws:
IOException
-
extractInnerHitBuilders
- Overrides:
extractInnerHitBuildersin classAbstractQueryBuilder<HasParentQueryBuilder>
-