[ES|QL] Hide "not" operators from suggestions menu (#216355)

## Summary

in https://github.com/elastic/kibana/pull/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 <efstratia.kalafateli@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Drew Tate 2025-03-31 13:25:08 -06:00 committed by GitHub
parent 35b7a4aa12
commit 4970bb95cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -712,7 +712,7 @@ const enrichOperators = (
const isInOperator = op.name === 'in' || op.name === 'not_in';
const isLikeOperator = /like/i.test(op.name);
const isNotOperator =
op.name?.toLowerCase()?.startsWith('not_') && (isInOperator || isInOperator);
op.name?.toLowerCase()?.startsWith('not_') && (isInOperator || isLikeOperator);
let signatures = op.signatures.map((s) => ({
...s,
@ -844,7 +844,7 @@ function printGeneratedFunctionsFile(
name: '${functionName}',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.${name}', { defaultMessage: ${JSON.stringify(
removeAsciiDocInternalCrossReferences(removeInlineAsciiDocLinks(description), functionNames)
)} }),${functionDefinition.ignoreAsSuggestion ? 'ignoreAsSuggestion: true,\n' : ''}
)} }),${functionDefinition.ignoreAsSuggestion ? 'ignoreAsSuggestion: true,' : ''}
preview: ${functionDefinition.preview || 'false'},
alias: ${alias ? `['${alias.join("', '")}']` : 'undefined'},
signatures: ${JSON.stringify(signatures, null, 2)},

View file

@ -3828,7 +3828,6 @@ const notInDefinition: FunctionDefinition = {
'The `NOT IN` operator allows testing whether a field or expression does *not* equal any element in a list of literals, fields or expressions.',
}),
ignoreAsSuggestion: true,
preview: false,
alias: undefined,
signatures: [
@ -4070,6 +4069,7 @@ const notLikeDefinition: FunctionDefinition = {
defaultMessage:
'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.',
}),
ignoreAsSuggestion: true,
preview: false,
alias: undefined,
signatures: [
@ -4119,6 +4119,7 @@ const notRlikeDefinition: FunctionDefinition = {
defaultMessage:
'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.',
}),
ignoreAsSuggestion: true,
preview: false,
alias: undefined,
signatures: [