public class NestedQueryBuilder extends AbstractQueryBuilder<NestedQueryBuilder>
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_PARAMSMAX_REWRITE_ROUNDS| Constructor and Description |
|---|
NestedQueryBuilder(StreamInput in)
Read from a stream.
|
NestedQueryBuilder(java.lang.String path,
QueryBuilder query,
org.apache.lucene.search.join.ScoreMode scoreMode) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doEquals(NestedQueryBuilder that)
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
protected QueryBuilder |
doRewrite(QueryRewriteContext queryRewriteContext) |
protected org.apache.lucene.search.Query |
doToQuery(QueryShardContext context) |
protected void |
doWriteTo(StreamOutput out) |
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitContextBuilder> innerHits)
For internal usage only!
Extracts the inner hits from the query tree.
|
static NestedQueryBuilder |
fromXContent(XContentParser parser) |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
boolean |
ignoreUnmapped()
Gets whether the query builder will ignore unmapped fields (and run a
MatchNoDocsQuery in place of this query) or throw an exception if
the path is unmapped. |
NestedQueryBuilder |
ignoreUnmapped(boolean ignoreUnmapped)
Sets whether the query builder should ignore unmapped paths (and run a
MatchNoDocsQuery in place of this query) or throw an exception if
the path is unmapped. |
InnerHitBuilder |
innerHit()
Returns inner hit definition in the scope of this query and reusing the defined type and query.
|
NestedQueryBuilder |
innerHit(InnerHitBuilder innerHitBuilder) |
static org.apache.lucene.search.join.ScoreMode |
parseScoreMode(java.lang.String scoreModeString) |
QueryBuilder |
query()
Returns the nested query to execute.
|
org.apache.lucene.search.join.ScoreMode |
scoreMode()
Returns how the scores from the matching child documents are mapped into the nested parent document.
|
static java.lang.String |
scoreModeAsString(org.apache.lucene.search.join.ScoreMode scoreMode) |
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, declareStandardFields, equals, getName, hashCode, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQueries, toQuery, toXContent, writeQueries, writeTobuildAsBytes, buildAsBytes, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentrewrite, rewrite, rewrite, rewriteAndFetch, rewriteAndFetchpublic static final java.lang.String NAME
public static final boolean DEFAULT_IGNORE_UNMAPPED
public NestedQueryBuilder(java.lang.String path,
QueryBuilder query,
org.apache.lucene.search.join.ScoreMode scoreMode)
public NestedQueryBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionprotected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo in class AbstractQueryBuilder<NestedQueryBuilder>java.io.IOExceptionpublic QueryBuilder query()
public InnerHitBuilder innerHit()
public NestedQueryBuilder innerHit(InnerHitBuilder innerHitBuilder)
public org.apache.lucene.search.join.ScoreMode scoreMode()
public NestedQueryBuilder ignoreUnmapped(boolean ignoreUnmapped)
MatchNoDocsQuery in place of this query) or throw an exception if
the path is unmapped.public boolean ignoreUnmapped()
MatchNoDocsQuery in place of this query) or throw an exception if
the path is unmapped.protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent in class AbstractQueryBuilder<NestedQueryBuilder>java.io.IOExceptionpublic static NestedQueryBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.search.join.ScoreMode parseScoreMode(java.lang.String scoreModeString)
public static java.lang.String scoreModeAsString(org.apache.lucene.search.join.ScoreMode scoreMode)
public final java.lang.String getWriteableName()
NamedWriteableprotected boolean doEquals(NestedQueryBuilder that)
AbstractQueryBuilderQueryBuilder object of the same type is "equal to" this one.doEquals in class AbstractQueryBuilder<NestedQueryBuilder>protected int doHashCode()
doHashCode in class AbstractQueryBuilder<NestedQueryBuilder>protected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException
doToQuery in class AbstractQueryBuilder<NestedQueryBuilder>java.io.IOExceptionprotected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws java.io.IOException
doRewrite in class AbstractQueryBuilder<NestedQueryBuilder>java.io.IOExceptionpublic void extractInnerHitBuilders(java.util.Map<java.lang.String,InnerHitContextBuilder> innerHits)
AbstractQueryBuilderextractInnerHitBuilders in class AbstractQueryBuilder<NestedQueryBuilder>