Skip to content

Commit 471ef15

Browse files
authored
[9.0] [ES|QL] Hide "not" operators from suggestions menu (#216355) (#216544)
# Backport This will backport the following commits from `main` to `9.0`: - [[ES|QL] Hide "not" operators from suggestions menu (#216355)](#216355) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-31T19:25:08Z","message":"[ES|QL] Hide \"not\" operators from suggestions menu (#216355)\n\n## Summary\n\nin #205565 we accidentally removed\nthe behavior where we don't show `NOT LIKE` and `NOT RLIKE` in the\nsuggestions list. We want to show these eventually but right now, it's\nbroken behavior:\n\n\n\nhttps://github.com/user-attachments/assets/0a7f860d-3a12-49cf-94b3-668848cff6ae\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"4970bb95ccb99b7cedfde51a3f4d56906607e28d","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Feature:ES|QL","Team:ESQL","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[ES|QL] Hide \"not\" operators from suggestions menu","number":216355,"url":"https://github.com/elastic/kibana/pull/216355","mergeCommit":{"message":"[ES|QL] Hide \"not\" operators from suggestions menu (#216355)\n\n## Summary\n\nin #205565 we accidentally removed\nthe behavior where we don't show `NOT LIKE` and `NOT RLIKE` in the\nsuggestions list. We want to show these eventually but right now, it's\nbroken behavior:\n\n\n\nhttps://github.com/user-attachments/assets/0a7f860d-3a12-49cf-94b3-668848cff6ae\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"4970bb95ccb99b7cedfde51a3f4d56906607e28d"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216355","number":216355,"mergeCommit":{"message":"[ES|QL] Hide \"not\" operators from suggestions menu (#216355)\n\n## Summary\n\nin #205565 we accidentally removed\nthe behavior where we don't show `NOT LIKE` and `NOT RLIKE` in the\nsuggestions list. We want to show these eventually but right now, it's\nbroken behavior:\n\n\n\nhttps://github.com/user-attachments/assets/0a7f860d-3a12-49cf-94b3-668848cff6ae\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"4970bb95ccb99b7cedfde51a3f4d56906607e28d"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/216533","number":216533,"state":"OPEN"}]}] BACKPORT-->
1 parent effc619 commit 471ef15

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/platform/packages/shared/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ const enrichOperators = (
622622
const isInOperator = op.name === 'in' || op.name === 'not_in';
623623
const isLikeOperator = /like/i.test(op.name);
624624
const isNotOperator =
625-
op.name?.toLowerCase()?.startsWith('not_') && (isInOperator || isInOperator);
625+
op.name?.toLowerCase()?.startsWith('not_') && (isInOperator || isLikeOperator);
626626

627627
let signatures = op.signatures.map((s) => ({
628628
...s,
@@ -743,7 +743,7 @@ function printGeneratedFunctionsFile(
743743
name: '${functionName}',
744744
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.${name}', { defaultMessage: ${JSON.stringify(
745745
removeAsciiDocInternalCrossReferences(removeInlineAsciiDocLinks(description), functionNames)
746-
)} }),${functionDefinition.ignoreAsSuggestion ? 'ignoreAsSuggestion: true,\n' : ''}
746+
)} }),${functionDefinition.ignoreAsSuggestion ? 'ignoreAsSuggestion: true,' : ''}
747747
preview: ${functionDefinition.preview || 'false'},
748748
alias: ${alias ? `['${alias.join("', '")}']` : 'undefined'},
749749
signatures: ${JSON.stringify(signatures, null, 2)},

src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/generated/operators.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4513,6 +4513,7 @@ const notLikeDefinition: FunctionDefinition = {
45134513
}),
45144514
preview: false,
45154515
alias: undefined,
4516+
ignoreAsSuggestion: true,
45164517
signatures: [
45174518
{
45184519
params: [
@@ -4563,6 +4564,7 @@ const notRlikeDefinition: FunctionDefinition = {
45634564
}),
45644565
preview: false,
45654566
alias: undefined,
4567+
ignoreAsSuggestion: true,
45664568
signatures: [
45674569
{
45684570
params: [

0 commit comments

Comments
 (0)