Class SingleValueQuery.SyntheticSourceDelegateBuilder
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,QueryBuilder,Rewriteable<QueryBuilder>,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
- Enclosing class:
SingleValueQuery
bool query ANDing the "next" query, a SingleValueMatchQuery,
and a TermQuery making sure we didn't ignore any values. Three total queries.
This is only used if the "next" query matches fields that would not be ignored. Read all
the paragraphs below to understand it. It's tricky!
This is used in the case when you do text_field == "foo" and text_field
has a keyword sub-field. See, text typed fields can't do our equality -
they only do matching. But keyword fields *can* do the equality. In this case
the "next" query is a TermQuery like text_field.raw:foo.
But there's a big wrinkle! If you index a field longer than ignore_above into
text_field.raw field then it'll drop its value on the floor. So the
SingleValueMatchQuery isn't enough to emulate ==. You have to remove
any matches that ignored a field. Luckily we have IgnoredFieldMapper! We can
do a TermQuery like NOT(_ignored:text_field.raw) to filter those out.
You may be asking, "how would the first text_field.raw:foo query work if the
value we're searching for is very long?" In that case we never use this query at all.
We have to delegate the filtering to the compute engine. No fancy lucene searches in
that case.
-
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>, Writeable.Writer<V> -
Field Summary
Fields 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, EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptionprotected final org.apache.lucene.search.QuerydoToQuery(SearchExecutionContext context) protected voiddoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) protected SingleValueQuery.AbstractBuilderrewrite(QueryBuilder next) Methods inherited from class org.elasticsearch.xpack.esql.querydsl.query.SingleValueQuery.AbstractBuilder
doEquals, doHashCode, doRewrite, doWriteTo, field, fieldName, next, simple, sourceMethods inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, boostAndQueryNameToXContent, checkNegativeBoost, declareStandardFields, doCoordinatorRewrite, doIndexMetadataRewrite, doInnerHitsRewrite, doSearchRewrite, equals, extractInnerHitBuilders, getMaxNestedDepth, getName, hashCode, parseInnerQueryBuilder, parseTopLevelQuery, parseTopLevelQuery, printBoostAndQueryName, queryName, queryName, readQueries, requireValue, rewrite, setMaxNestedDepth, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeQueries, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
supportsVersion
-
Method Details
-
getWriteableName
-
doXContent
protected void doXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
doXContentin classAbstractQueryBuilder<SingleValueQuery.AbstractBuilder>- Throws:
IOException
-
getMinimalSupportedVersion
-
doToQuery
protected final org.apache.lucene.search.Query doToQuery(SearchExecutionContext context) throws IOException - Specified by:
doToQueryin classAbstractQueryBuilder<SingleValueQuery.AbstractBuilder>- Throws:
IOException
-
rewrite
- Specified by:
rewritein classSingleValueQuery.AbstractBuilder
-