[ES|QL] Suggest all operators in the editor#223503
Conversation
| locationsAvailable, | ||
| type: FunctionDefinitionTypes.OPERATOR, | ||
| validate: mathValidators[op.name], | ||
| ...(isNotOperator ? { ignoreAsSuggestion: true } : {}), |
There was a problem hiding this comment.
Now we are not ignoring any operator!
| } | ||
|
|
||
| const functionDefinition = getFunctionDefinition(ESDefinition); | ||
| const isLikeOperator = functionDefinition.name.toLowerCase().includes('like'); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
I changed the operators to not use underscore following is null and is not null ast. It also simplifies some things
|
Pinging @elastic/kibana-esql (Team:ESQL) |
vadimkibana
left a comment
There was a problem hiding this comment.
LGTM, code review only.
| @@ -155,8 +155,6 @@ const enrichOperators = ( | |||
|
|
|||
| const isInOperator = op.name === 'in' || op.name === 'not_in'; | |||
There was a problem hiding this comment.
Should this be not in, similar to other changes?
| const isInOperator = op.name === 'in' || op.name === 'not_in'; | |
| const isInOperator = op.name === 'in' || op.name === 'not in'; |
There was a problem hiding this comment.
No this property comes like that from es
...rm/packages/shared/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts
Outdated
Show resolved
Hide resolved
…scripts/generate_function_definitions.ts Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
|
Starting backport for target branches: 8.19 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
History
|
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## 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
# 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-->
Summary
Closes #216418
This PR is cleaning up the definitions in order to suggest all operators. We were not suggesting all
LIKEoperators and theNOT ....operators.Important notes
Checklist