diff --git a/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.test.ts b/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.test.ts index 0b6c0df274cef..e4c7e7cbd9299 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.test.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.test.ts @@ -253,6 +253,18 @@ describe('RERANK Autocomplete', () => { await expectRerankSuggestions(query, NEXT_ACTIONS_EXPRESSIONS); }); + + test('suggests next actions after simple field assignment', async () => { + const query = + buildRerankQuery({ + query: '"search query"', + onClause: 'col0 = keywordField', + }) + ' '; + + await expectRerankSuggestions(query, { + contains: NEXT_ACTIONS, + }); + }); }); describe('Terminal operators', () => { diff --git a/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.ts b/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.ts index 0c4e8dc9ee835..6678810c8b396 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/commands/registry/rerank/autocomplete.ts @@ -235,9 +235,9 @@ async function handleOnExpression({ }, }); - const { expressionType, isComplete, insideFunction } = computed; + const { isComplete, insideFunction } = computed; - if (expressionRoot && expressionType === 'boolean' && isComplete && !insideFunction) { + if (expressionRoot && isComplete && !insideFunction) { suggestions.push(...buildNextActions()); }