-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL - full text functions verifier tests refactor #128775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
carlosdelest
merged 18 commits into
elastic:main
from
carlosdelest:non-issue/esql-full-text-functions-verifier-tests-refactor
Jun 3, 2025
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
28c00b2
Refactor verifier tests
carlosdelest cd7a468
Refactor verifier tests
carlosdelest c417c01
Simplify tests
carlosdelest ba53a4d
Simplify tests
carlosdelest e35cb96
Simplify tests
carlosdelest 6580832
Fix merge
carlosdelest b35e06f
Merge branch 'main' into non-issue/esql-full-text-functions-verifier-…
carlosdelest 43997d8
Add capabilities checks
carlosdelest 0dda9d2
Merge remote-tracking branch 'carlosdelest/non-issue/esql-full-text-f…
carlosdelest 3cfdccb
Merge branch 'main' into non-issue/esql-full-text-functions-verifier-…
carlosdelest 713de2b
Add new full text functions data set and modify VerifierTests
carlosdelest 1774cb0
Don't use data with the CSV data loader, just the mapping
carlosdelest 0742884
Spotless
carlosdelest ac0982a
Fix naming and visibility of helper methods
carlosdelest f3da4da
Fix merge
carlosdelest 94bb978
Merge remote-tracking branch 'carlosdelest/non-issue/esql-full-text-f…
carlosdelest 2818298
Fix naming of helper methods
carlosdelest ede0896
Remove colors dataset from knn
carlosdelest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-full_text_search.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -204,23 +204,7 @@ private static void checkFullTextQueryFunctions(LogicalPlan plan, Failures failu | |
| 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, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplified this to just run on all |
||
| lp -> (lp instanceof Limit == false) && (lp instanceof Aggregate == false), | ||
| m -> "[" + m.functionName() + "] " + m.functionType(), | ||
| failures | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -379,7 +379,7 @@ public String functionName() { | |
| private TypeResolution resolveFields() { | ||
| return fields.stream() | ||
| .map( | ||
| (Expression field) -> isNotNull(field, sourceText(), FIRST).and( | ||
| (Expression field) -> isNotNull(field, sourceText(), SECOND).and( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed a bug in MultiMatch when refactoring the tests |
||
| isType( | ||
| field, | ||
| FIELD_DATA_TYPES::contains, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this new mapping, as I found easier when working on KNN to have a separate mapping for full text functions than to modify the default mapping - which impacted a lot of other tests.
This way we can be the owners of this mapping in case we want to add later for example sparse_vector field types, and not impact other test cases.