-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Discover] Add feature flag to make ESQL the default query mode #252268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexGPlay
merged 2 commits into
elastic:main
from
AlexGPlay:250201-feature-flag-to-default-to-esql
Feb 10, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/platform/test/functional/apps/discover/query_mode_esql_default/_default_query_mode.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
| import expect from '@kbn/expect'; | ||
| import type { FtrProviderContext } from '../ftr_provider_context'; | ||
|
|
||
| export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
| const { discover, common, unifiedSearch } = getPageObjects([ | ||
| 'discover', | ||
| 'common', | ||
| 'unifiedSearch', | ||
| ]); | ||
|
|
||
| describe('Default query mode', () => { | ||
| afterEach(async () => { | ||
| await discover.resetQueryMode(); | ||
| }); | ||
|
|
||
| describe('when there is no default query mode set', () => { | ||
| it('should open Discover in ESQL mode', async () => { | ||
| // Validate that no default query mode is set | ||
| await common.navigateToApp('discover'); | ||
| const queryMode = await discover.getQueryMode(); | ||
| expect(queryMode).to.be(null); | ||
|
|
||
| // Go to discover and validate ESQL mode | ||
| await discover.isInEsqlMode(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('when the user clicks ES|QL mode', () => { | ||
| it('should set the default mode to ES|QL', async () => { | ||
| // Go to discover and select ES|QL mode | ||
| await common.navigateToApp('discover'); | ||
| await unifiedSearch.switchToDataViewMode(); | ||
| await discover.selectTextBaseLang(); | ||
| const queryMode = await discover.getQueryMode(); | ||
| expect(queryMode).to.contain('esql'); | ||
|
|
||
| // Reload the app and validate ES|QL mode is persisted | ||
| await common.navigateToApp('discover', { path: '' }); | ||
| await discover.isInEsqlMode(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('when the user clicks classic', () => { | ||
| it('should set the default mode to classic', async () => { | ||
| // Go to discover and select classic mode | ||
| await common.navigateToApp('discover'); | ||
| await unifiedSearch.switchToDataViewMode(); | ||
| const queryMode = await discover.getQueryMode(); | ||
| expect(queryMode).to.contain('classic'); | ||
|
|
||
| // Reload the app and validate classic mode is persisted | ||
| await common.navigateToApp('discover', { path: '' }); | ||
| await discover.isInClassicMode(); | ||
| }); | ||
| }); | ||
| }); | ||
| } |
27 changes: 27 additions & 0 deletions
27
src/platform/test/functional/apps/discover/query_mode_esql_default/config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| import type { FtrConfigProviderContext } from '@kbn/test'; | ||
|
|
||
| export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
| const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); | ||
| const kbnTestServer = functionalConfig.get('kbnTestServer'); | ||
|
|
||
| return { | ||
| ...functionalConfig.getAll(), | ||
| kbnTestServer: { | ||
| ...kbnTestServer, | ||
| serverArgs: [ | ||
| ...kbnTestServer.serverArgs, | ||
| '--feature_flags.overrides.discover.isEsqlDefault=true', | ||
| ], | ||
| }, | ||
| testFiles: [require.resolve('.')], | ||
| }; | ||
| } |
31 changes: 31 additions & 0 deletions
31
src/platform/test/functional/apps/discover/query_mode_esql_default/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
| import type { FtrProviderContext } from '../ftr_provider_context'; | ||
|
|
||
| export default function ({ getService, loadTestFile }: FtrProviderContext) { | ||
| const esArchiver = getService('esArchiver'); | ||
| const browser = getService('browser'); | ||
|
|
||
| describe('discover/query_mode_esql_default', function () { | ||
| before(async function () { | ||
| await esArchiver.loadIfNeeded( | ||
| 'src/platform/test/functional/fixtures/es_archiver/logstash_functional' | ||
| ); | ||
| await browser.setWindowSize(1600, 1200); | ||
| }); | ||
|
|
||
| after(async function unloadMakelogs() { | ||
| await esArchiver.unload( | ||
| 'src/platform/test/functional/fixtures/es_archiver/logstash_functional' | ||
| ); | ||
| }); | ||
|
|
||
| loadTestFile(require.resolve('./_default_query_mode')); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We could move the check for
classichigher and combine the 2 checks for ES|QL initial query.