Skip to content

[ES|QL] Suggest all operators in the editor#223503

Merged
stratoula merged 6 commits intoelastic:mainfrom
stratoula:fix-like-not-operators
Jun 18, 2025
Merged

[ES|QL] Suggest all operators in the editor#223503
stratoula merged 6 commits intoelastic:mainfrom
stratoula:fix-like-not-operators

Conversation

@stratoula
Copy link
Contributor

@stratoula stratoula commented Jun 12, 2025

Summary

Closes #216418

This PR is cleaning up the definitions in order to suggest all operators. We were not suggesting all LIKE operators and the NOT .... operators.

Important notes

  • Now NOT IN works exactly like IN 🎉
image
  • LIKE, NOT LIKE, RLIKE, NOT RLIKE work exactly like LIKE (we were suggesting like). After this operator is been selected we are suggesting wrong suggestions but as it is not the purpose of this PR to fix this and this behavior already exists in main I will add it here [ES|QL] Autocomplete suggestions improvements #176033 and we can follow up.
image

Checklist

locationsAvailable,
type: FunctionDefinitionTypes.OPERATOR,
validate: mathValidators[op.name],
...(isNotOperator ? { ignoreAsSuggestion: true } : {}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we are not ignoring any operator!

}

const functionDefinition = getFunctionDefinition(ESDefinition);
const isLikeOperator = functionDefinition.name.toLowerCase().includes('like');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like is correctly categorized as operator, this distinction was not necessary here


function visitLogicalIns(ctx: LogicalInContext) {
const fn = createFunction(ctx.NOT() ? 'not_in' : 'in', ctx, undefined, 'binary-expression');
const fn = createFunction(ctx.NOT() ? 'not in' : 'in', ctx, undefined, 'binary-expression');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the operators to not use underscore following is null and is not null ast. It also simplifies some things

@stratoula stratoula added v9.1.0 v8.19.0 Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// backport:version Backport to applied version labels release_note:enhancement labels Jun 12, 2025
@stratoula stratoula marked this pull request as ready for review June 12, 2025 14:49
@stratoula stratoula requested a review from a team as a code owner June 12, 2025 14:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

Copy link
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, code review only.

@@ -155,8 +155,6 @@ const enrichOperators = (

const isInOperator = op.name === 'in' || op.name === 'not_in';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be not in, similar to other changes?

Suggested change
const isInOperator = op.name === 'in' || op.name === 'not_in';
const isInOperator = op.name === 'in' || op.name === 'not in';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this property comes like that from es

…scripts/generate_function_definitions.ts

Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
@stratoula stratoula enabled auto-merge (squash) June 18, 2025 11:14
@stratoula stratoula merged commit 825172e into elastic:main Jun 18, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15732045142

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #73 / EQL execution logic API @ess @serverless @serverlessQA EQL type rules uses the provided timestamp_field

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.7MB 3.7MB -78.0B

History

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 223503

Questions ?

Please refer to the Backport tool documentation

@stratoula
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

stratoula added a commit to stratoula/kibana that referenced this pull request Jun 18, 2025
## Summary

Closes elastic#216418

This PR is cleaning up the definitions in order to suggest all
operators. We were not suggesting all `LIKE` operators and the `NOT
....` operators.

### Important notes

- Now NOT IN works exactly like IN 🎉

<img width="784" alt="image"
src="https://github.com/user-attachments/assets/e7e96c2a-0f28-4868-919c-9e5995e5f0ce"
/>

- LIKE, NOT LIKE, RLIKE, NOT RLIKE work exactly like LIKE (we were
suggesting like). After this operator is been selected we are suggesting
wrong suggestions but as it is not the purpose of this PR to fix this
and this behavior already exists in main I will add it here
elastic#176033 and we can follow up.

<img width="765" alt="image"
src="https://github.com/user-attachments/assets/bfd3a8af-845a-4aed-b903-214d83e073e0"
/>

### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
(cherry picked from commit 825172e)

# Conflicts:
#	src/platform/packages/shared/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts
#	src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/generated/operators.ts
stratoula added a commit that referenced this pull request Jun 18, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[ES|QL] Suggest all operators in the editor
(#223503)](#223503)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-06-18T11:51:13Z","message":"[ES|QL]
Suggest all operators in the editor (#223503)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/216418\n\nThis PR is cleaning
up the definitions in order to suggest all\noperators. We were not
suggesting all `LIKE` operators and the `NOT\n....` operators.\n\n###
Important notes\n\n- Now NOT IN works exactly like IN 🎉 \n\n<img
width=\"784\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e7e96c2a-0f28-4868-919c-9e5995e5f0ce\"\n/>\n\n-
LIKE, NOT LIKE, RLIKE, NOT RLIKE work exactly like LIKE (we
were\nsuggesting like). After this operator is been selected we are
suggesting\nwrong suggestions but as it is not the purpose of this PR to
fix this\nand this behavior already exists in main I will add it
here\nhttps://github.com//issues/176033 and we can follow
up.\n\n<img width=\"765\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bfd3a8af-845a-4aed-b903-214d83e073e0\"\n/>\n\n\n###
Checklist\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios\n\n---------\n\nCo-authored-by: Vadim Kibana
<82822460+vadimkibana@users.noreply.github.com>","sha":"825172ebed249cac0c214d6e29958d635d3f0e69","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL]
Suggest all operators in the
editor","number":223503,"url":"https://github.com/elastic/kibana/pull/223503","mergeCommit":{"message":"[ES|QL]
Suggest all operators in the editor (#223503)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/216418\n\nThis PR is cleaning
up the definitions in order to suggest all\noperators. We were not
suggesting all `LIKE` operators and the `NOT\n....` operators.\n\n###
Important notes\n\n- Now NOT IN works exactly like IN 🎉 \n\n<img
width=\"784\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e7e96c2a-0f28-4868-919c-9e5995e5f0ce\"\n/>\n\n-
LIKE, NOT LIKE, RLIKE, NOT RLIKE work exactly like LIKE (we
were\nsuggesting like). After this operator is been selected we are
suggesting\nwrong suggestions but as it is not the purpose of this PR to
fix this\nand this behavior already exists in main I will add it
here\nhttps://github.com//issues/176033 and we can follow
up.\n\n<img width=\"765\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bfd3a8af-845a-4aed-b903-214d83e073e0\"\n/>\n\n\n###
Checklist\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios\n\n---------\n\nCo-authored-by: Vadim Kibana
<82822460+vadimkibana@users.noreply.github.com>","sha":"825172ebed249cac0c214d6e29958d635d3f0e69"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223503","number":223503,"mergeCommit":{"message":"[ES|QL]
Suggest all operators in the editor (#223503)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/216418\n\nThis PR is cleaning
up the definitions in order to suggest all\noperators. We were not
suggesting all `LIKE` operators and the `NOT\n....` operators.\n\n###
Important notes\n\n- Now NOT IN works exactly like IN 🎉 \n\n<img
width=\"784\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e7e96c2a-0f28-4868-919c-9e5995e5f0ce\"\n/>\n\n-
LIKE, NOT LIKE, RLIKE, NOT RLIKE work exactly like LIKE (we
were\nsuggesting like). After this operator is been selected we are
suggesting\nwrong suggestions but as it is not the purpose of this PR to
fix this\nand this behavior already exists in main I will add it
here\nhttps://github.com//issues/176033 and we can follow
up.\n\n<img width=\"765\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bfd3a8af-845a-4aed-b903-214d83e073e0\"\n/>\n\n\n###
Checklist\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios\n\n---------\n\nCo-authored-by: Vadim Kibana
<82822460+vadimkibana@users.noreply.github.com>","sha":"825172ebed249cac0c214d6e29958d635d3f0e69"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:ES|QL ES|QL related features in Kibana release_note:enhancement Team:ESQL ES|QL related features in Kibana t// v8.19.0 v9.1.0

4 participants