ESQL - full text functions verifier tests refactor (#128775)

This commit is contained in:
Carlos Delgado 2025-06-03 14:59:57 +02:00 committed by GitHub
parent 3f1e1b3c30
commit dc3d515226
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 316 additions and 629 deletions

View File

@ -0,0 +1,26 @@
{
"properties": {
"id": {
"type": "integer"
},
"title": {
"type": "text"
},
"body": {
"type": "text"
},
"tags": {
"type": "keyword"
},
"category": {
"type": "integer"
},
"published_date": {
"type": "date"
},
"vector": {
"type": "dense_vector",
"similarity": "l2_norm"
}
}
}

View File

@ -204,23 +204,7 @@ public abstract class FullTextFunction extends Function
checkCommandsBeforeExpression(
plan,
condition,
Match.class,
lp -> (lp instanceof Limit == false) && (lp instanceof Aggregate == false),
m -> "[" + m.functionName() + "] " + m.functionType(),
failures
);
checkCommandsBeforeExpression(
plan,
condition,
MultiMatch.class,
lp -> (lp instanceof Limit == false) && (lp instanceof Aggregate == false),
m -> "[" + m.functionName() + "] " + m.functionType(),
failures
);
checkCommandsBeforeExpression(
plan,
condition,
Term.class,
FullTextFunction.class,
lp -> (lp instanceof Limit == false) && (lp instanceof Aggregate == false),
m -> "[" + m.functionName() + "] " + m.functionType(),
failures

View File

@ -379,7 +379,7 @@ public class MultiMatch extends FullTextFunction implements OptionalArgument, Po
private TypeResolution resolveFields() {
return fields.stream()
.map(
(Expression field) -> isNotNull(field, sourceText(), FIRST).and(
(Expression field) -> isNotNull(field, sourceText(), SECOND).and(
isType(
field,
FIELD_DATA_TYPES::contains,