Class Match
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisPlanVerificationAware,PostOptimizationPlanVerificationAware,PostOptimizationVerificationAware,RewriteableAware,TranslationAware,Resolvable,EvaluatorMapper,ConfigurationFunction,OptionalArgument,ExpressionScoreMapper
- Direct Known Subclasses:
MatchOperator
MatchQuery .-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.tree.Node
Node.NodeStringFormatNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
EvaluatorMapper.ToEvaluatorNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.score.ExpressionScoreMapper
ExpressionScoreMapper.ToScorerNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.capabilities.PostOptimizationVerificationAware
PostOptimizationVerificationAware.CoordinatorOnlyNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.capabilities.TranslationAware
TranslationAware.FinishedTranslatable, TranslationAware.SingleValueTranslationAware, TranslationAware.TranslatableNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FunctionDefinitionstatic final NamedWriteableRegistry.EntryFields inherited from class org.elasticsearch.xpack.esql.expression.function.fulltext.SingleFieldFullTextFunction
fieldFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionMatch(Source source, Expression field, Expression matchQuery, Expression options, QueryBuilder queryBuilder, Configuration configuration) Match(Source source, Expression field, Expression matchQuery, Expression options, Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected Configurationbooleanbooleanprotected voidfieldVerifier(LogicalPlan plan, FullTextFunction function, Expression field, Failures failures) Returns the allowed options map for this function.Returns the set of allowed data types for the field parameter.Returns the set of allowed data types for the query parameter.inthashCode()protected NodeInfo<? extends Expression> info()Normally, you want to use one of the staticcreatemethods to implement this.protected booleanreplaceChildren(List<Expression> newChildren) replaceQueryBuilder(QueryBuilder queryBuilder) Replaces the current query builder with a rewritten iteration.protected Expression.TypeResolutionResolves the type for the function parameters, as part of the type resolution for the functiontoEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Convert this into anExpressionEvaluator.translatable(LucenePushdownPredicates pushdownPredicates) Can this instance be translated or not? Usually checks whether the expression arguments are actual fields that exist in Lucene.protected Querytranslate(LucenePushdownPredicates pushdownPredicates, TranslatorHandler handler) final voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.expression.function.fulltext.SingleFieldFullTextFunction
expectedFieldTypesString, expectedQueryTypesString, field, fieldAsFieldAttribute, fold, foldable, nullable, options, postAnalysisPlanVerification, postOptimizationPlanVerification, queryAsObject, resolveField, resolveOptions, resolveQueryMethods inherited from class org.elasticsearch.xpack.esql.expression.function.fulltext.FullTextFunction
asQuery, dataType, evaluatorQueryBuilder, fieldAsFieldAttribute, functionType, getNameFromFieldAttribute, postOptimizationVerification, query, queryBuilder, requiresQueryBuilderRewrite, resolveQuery, resolveType, toScorerMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, functionName, nodeStringMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, propertiesToString, references, resolved, semanticEquals, semanticHash, toString, toString, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
allMatch, anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, transformChildren, transformChildren, transformDown, transformDown, transformDown, transformDown, transformDownSkipBranch, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
foldMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.TranslationAware
asLuceneQuery
-
Field Details
-
ENTRY
-
DEFINITION
-
FIELD_DATA_TYPES
-
QUERY_DATA_TYPES
-
ALLOWED_OPTIONS
-
-
Constructor Details
-
Match
public Match(Source source, Expression field, Expression matchQuery, Expression options, Configuration configuration) -
Match
public Match(Source source, Expression field, Expression matchQuery, Expression options, QueryBuilder queryBuilder, Configuration configuration)
-
-
Method Details
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
resolveParams
Description copied from class:FullTextFunctionResolves the type for the function parameters, as part of the type resolution for the function- Overrides:
resolveParamsin classSingleFieldFullTextFunction- Returns:
- type resolution for the function parameters
-
getFieldDataTypes
Description copied from class:SingleFieldFullTextFunctionReturns the set of allowed data types for the field parameter. Each subclass defines which field types it supports.- Specified by:
getFieldDataTypesin classSingleFieldFullTextFunction
-
getQueryDataTypes
Description copied from class:SingleFieldFullTextFunctionReturns the set of allowed data types for the query parameter. Each subclass defines which query types it supports.- Specified by:
getQueryDataTypesin classSingleFieldFullTextFunction
-
getAllowedOptions
Description copied from class:SingleFieldFullTextFunctionReturns the allowed options map for this function. Keys are option names, values are the expected data types.- Specified by:
getAllowedOptionsin classSingleFieldFullTextFunction
-
configuration
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods to implement this.For
QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Specified by:
infoin classNode<Expression>
-
replaceChildren
- Specified by:
replaceChildrenin classNode<Expression>
-
replaceQueryBuilder
Description copied from interface:RewriteableAwareReplaces the current query builder with a rewritten iteration. This happens multiple times through the rewrite phase until the final iteration of the query builder is stored.- Specified by:
replaceQueryBuilderin interfaceRewriteableAware- Parameters:
queryBuilder- QueryBuilder- Returns:
- Expression defining the active QueryBuilder
-
translate
- Specified by:
translatein classFullTextFunction
-
isRuntimeSearch
protected boolean isRuntimeSearch()- Overrides:
isRuntimeSearchin classFullTextFunction
-
translatable
Description copied from interface:TranslationAwareCan this instance be translated or not? Usually checks whether the expression arguments are actual fields that exist in Lucene. SeeTranslationAware.Translatablefor precisely what can be signaled from this method.- Specified by:
translatablein interfaceTranslationAware- Overrides:
translatablein classFullTextFunction
-
fieldVerifier
protected void fieldVerifier(LogicalPlan plan, FullTextFunction function, Expression field, Failures failures) - Overrides:
fieldVerifierin classFullTextFunction
-
toEvaluator
Description copied from interface:EvaluatorMapperConvert this into anExpressionEvaluator.Note for implementors: If you are implementing this function, you should call the passed-in lambda on your children, after doing any other manipulation (casting, etc.) necessary.
Note for Callers: If you are attempting to call this method, and you have an
Expressionand aLayout, you likely want to callEvalMapper.toEvaluator(org.elasticsearch.xpack.esql.core.expression.FoldContext, org.elasticsearch.xpack.esql.core.expression.Expression, org.elasticsearch.xpack.esql.planner.Layout)instead. On the other hand, if you already have something that looks like the parameter for this method, you should call this method with that function.Build an
ExpressionEvaluator.Factoryfor the tree of expressions rooted at this node. This is only guaranteed to return a sensible evaluator if this node has a valid type. If this node is a subclass ofExpressionthen "valid type" means thatExpression.typeResolved()returns a non-error resolution. If Expression.typeResolved() returns an error then this method may throw. Or return an evaluator that produces garbage. Or return an evaluator that throws when run.- Specified by:
toEvaluatorin interfaceEvaluatorMapper- Overrides:
toEvaluatorin classFullTextFunction
-
equals
- Overrides:
equalsin classSingleFieldFullTextFunction
-
hashCode
public int hashCode()- Overrides:
hashCodein classSingleFieldFullTextFunction
-
contributesToScore
public boolean contributesToScore()- Specified by:
contributesToScorein interfaceExpressionScoreMapper
-