Skip to content

[Discover] Add feature flag to make ESQL the default query mode#252268

Merged
AlexGPlay merged 2 commits intoelastic:mainfrom
AlexGPlay:250201-feature-flag-to-default-to-esql
Feb 10, 2026
Merged

[Discover] Add feature flag to make ESQL the default query mode#252268
AlexGPlay merged 2 commits intoelastic:mainfrom
AlexGPlay:250201-feature-flag-to-default-to-esql

Conversation

@AlexGPlay
Copy link
Copy Markdown
Contributor

@AlexGPlay AlexGPlay commented Feb 9, 2026

Summary

Closes #250201

Follow up to #250388 - now on top of storing the last used query mode, if there's nothing stored as the last one, and if possible, ES|QL will be the default when the isEsqlDefault feature flag is set to true.

Tip

To test it set feature_flags.overrides.discover.isEsqlDefault to true in your kibana.dev.yml

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@AlexGPlay AlexGPlay marked this pull request as ready for review February 9, 2026 15:33
@AlexGPlay AlexGPlay requested review from a team as code owners February 9, 2026 15:33
@AlexGPlay AlexGPlay self-assigned this Feb 9, 2026
@AlexGPlay AlexGPlay added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// labels Feb 9, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@AlexGPlay AlexGPlay added the Feature:Discover Discover Application label Feb 9, 2026
Copy link
Copy Markdown
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Left some minor suggestions.

const esArchiver = getService('esArchiver');
const browser = getService('browser');

describe('discover/query_mode', function () {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
describe('discover/query_mode', function () {
describe('discover/query_mode_esql_default', function () {

if (hasEsqlEnabled && queryMode === 'esql' && dataView instanceof DataView)
return { esql: getInitialESQLQuery(dataView, true) };
if (queryMode === 'esql' && canUseEsql) return { esql: getInitialESQLQuery(dataView, true) };
if (queryMode === 'classic') return services.data.query.queryString.getDefaultQuery();
Copy link
Copy Markdown
Contributor

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 classic higher and combine the 2 checks for ES|QL initial query.


// Reload the app and validate classic mode is persisted
await common.navigateToApp('discover', { path: '' });
await testSubjects.existOrFail('discover-dataView-switch-link');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to create new helpers instead of

  • await discover.expectSourceViewerToExist();
  • await testSubjects.existOrFail('discover-dataView-switch-link');

and call them rather:

  • isInESQLMode
  • isInClassicMode.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Feb 10, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #43 / serverless observability UI - telemetry discover/observabilitySolution/context_awareness/telemetry telemetry context should set EBT context for telemetry events when logs data source profile and reset

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 1.6MB 1.6MB +184.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
discover 25.2KB 25.2KB +36.0B

History

cc @AlexGPlay

@AlexGPlay AlexGPlay merged commit 6bf7b46 into elastic:main Feb 10, 2026
16 checks passed
mbondyra added a commit to mbondyra/kibana that referenced this pull request Feb 10, 2026
* commit '7dcc1fe3c205d2de0c3ca3f65804f21de09013c3': (285 commits)
  Enrich kbn-check-saved-objects-cli README with CI and manual usage docs (elastic#252557)
  [Discover] Add feature flag to make ESQL the default query mode (elastic#252268)
  Add maskProps.headerZindexLocation above to inspect component flyout (elastic#252543)
  [Security Solution][Atack/Alerts] Flyout header: Assignees  (elastic#252190)
  Upgrade EUI to v112.3.0 (elastic#252315)
  [Fleet] Make save_knowledge_base async in streaming state machine (elastic#252328)
  Upgrade @smithy/config-resolver 4.3.0 → 4.4.6 (elastic#252457)
  [Lens as API] Add colorMapping support for XY charts (ES|QL data layers) (elastic#252051)
  [WorkplaceAI] Add Google Drive data source and connector (elastic#250677)
  [Scout] Move GlobalSearch FTR tests to Scout (elastic#252201)
  [EDR Workflows] Fix osquery pack results display when agent clock is skewed (elastic#251417)
  [Observability Onboarding] Apply integrations limit after dedup in parseIntegrationsTSV (elastic#252486)
  [Entity Analytics] Update `host.ip` aggregation to remove painless script (elastic#252426)
  Address `@elastic/eui/require-table-caption` lint violations across `@elastic/obs-presentation-team` files (elastic#251050)
  Consolidate JSON stringify dependencies (elastic#251890)
  [index mgmt] Use esql instead of query dsl to get the index count (elastic#252422)
  Add Usage API Plugin (elastic#252434)
  Cases All Templates page (elastic#250372)
  [Agent Builder] Default value for optional params in ESQL tools (elastic#238472)
  [Fleet] Add upgrade_details.metadata.reason to AgentResponseSchema (elastic#252485)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Discover] Introduce feature flag for creating new Discover session using ES|QL

6 participants