Class SingleValueQuery.NegatedSyntheticSourceDelegateBuilder
java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<SingleValueQuery.AbstractBuilder>
org.elasticsearch.xpack.esql.querydsl.query.SingleValueQuery.AbstractBuilder
org.elasticsearch.xpack.esql.querydsl.query.SingleValueQuery.NegatedSyntheticSourceDelegateBuilder
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,QueryBuilder,Rewriteable<QueryBuilder>,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
- Enclosing class:
SingleValueQuery
public static class SingleValueQuery.NegatedSyntheticSourceDelegateBuilder
extends SingleValueQuery.AbstractBuilder
Builds a query matching either ignored values OR the union of
next query
and SingleValueMatchQuery. Three total queries. This is used to generate
candidate matches for queries like NOT(a == "b") where some values of a
are not indexed. In fact, let's use that as an example.
In that case you use a query for a != "b" as the "next" query. Then
this query will find all documents where a is single valued and
== "b" AND all documents that have ignored some values of a.
This produces candidate matches for NOT(a == "b").
It'll find documents like:
- "a"
- ignored_value
- ["a", ignored_value]
- [ignored_value1, ignored_value2]
- ["b", ignored_field]
The first and second of those should match NOT(a == "b").
The last three should be rejected. So! When using this query you must
push this query to the LuceneSourceOperator and
retain it in the FilterOperator.
This will not find:
- "b"
And that's also great! These can't match NOT(a == "b")
-
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
isFragment
-
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
-