Skip to content

Commit 4970bb9

Browse files
drewdaemonstratoulaelasticmachine
authored
[ES|QL] Hide "not" operators from suggestions menu (#216355)
## Summary in #205565 we accidentally removed the behavior where we don't show `NOT LIKE` and `NOT RLIKE` in the suggestions list. We want to show these eventually but right now, it's broken behavior: https://github.com/user-attachments/assets/0a7f860d-3a12-49cf-94b3-668848cff6ae --------- Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent 35b7a4a commit 4970bb9

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)