Skip to content

Commit ffee696

Browse files
[8.x] [ES|QL] Hide "not" operators from suggestions menu (#216355) (#216533)
# Backport This will backport the following commits from `main` to `8.x`: - [[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","8.x"],"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,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Drew Tate <[email protected]>
1 parent a751550 commit ffee696

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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
@@ -712,7 +712,7 @@ const enrichOperators = (
712712
const isInOperator = op.name === 'in' || op.name === 'not_in';
713713
const isLikeOperator = /like/i.test(op.name);
714714
const isNotOperator =
715-
op.name?.toLowerCase()?.startsWith('not_') && (isInOperator || isInOperator);
715+
op.name?.toLowerCase()?.startsWith('not_') && (isInOperator || isLikeOperator);
716716

717717
let signatures = op.signatures.map((s) => ({
718718
...s,
@@ -844,7 +844,7 @@ function printGeneratedFunctionsFile(
844844
name: '${functionName}',
845845
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.${name}', { defaultMessage: ${JSON.stringify(
846846
removeAsciiDocInternalCrossReferences(removeInlineAsciiDocLinks(description), functionNames)
847-
)} }),${functionDefinition.ignoreAsSuggestion ? 'ignoreAsSuggestion: true,\n' : ''}
847+
)} }),${functionDefinition.ignoreAsSuggestion ? 'ignoreAsSuggestion: true,' : ''}
848848
preview: ${functionDefinition.preview || 'false'},
849849
alias: ${alias ? `['${alias.join("', '")}']` : 'undefined'},
850850
signatures: ${JSON.stringify(signatures, null, 2)},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3828,7 +3828,6 @@ const notInDefinition: FunctionDefinition = {
38283828
'The `NOT IN` operator allows testing whether a field or expression does *not* equal any element in a list of literals, fields or expressions.',
38293829
}),
38303830
ignoreAsSuggestion: true,
3831-
38323831
preview: false,
38333832
alias: undefined,
38343833
signatures: [
@@ -4070,6 +4069,7 @@ const notLikeDefinition: FunctionDefinition = {
40704069
defaultMessage:
40714070
'Use `LIKE` to filter data based on string patterns using wildcards. `LIKE`\nusually acts on a field placed on the left-hand side of the operator, but it can\nalso act on a constant (literal) expression. The right-hand side of the operator\nrepresents the pattern.\n\nThe following wildcard characters are supported:\n\n* `*` matches zero or more characters.\n* `?` matches one character.',
40724071
}),
4072+
ignoreAsSuggestion: true,
40734073
preview: false,
40744074
alias: undefined,
40754075
signatures: [
@@ -4119,6 +4119,7 @@ const notRlikeDefinition: FunctionDefinition = {
41194119
defaultMessage:
41204120
'Use `RLIKE` to filter data based on string patterns using using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.',
41214121
}),
4122+
ignoreAsSuggestion: true,
41224123
preview: false,
41234124
alias: undefined,
41244125
signatures: [

0 commit comments

Comments
 (0)