Skip to content

[Background search] Enable the new background search UX#236818

Merged
kertal merged 21 commits intoelastic:mainfrom
kertal:data-background-search-enable
Sep 30, 2025
Merged

[Background search] Enable the new background search UX#236818
kertal merged 21 commits intoelastic:mainfrom
kertal:data-background-search-enable

Conversation

@kertal
Copy link
Member

@kertal kertal commented Sep 29, 2025

Resolves #229958

The PR enables our user to send to searches to the "background". This is especially useful for long running queries.

CleanShot.2025-09-29.at.21.22.48.mp4

Both in Discover and Dashboard the query bar "Refresh" button is extended with a "Send to background" button

CleanShot 2025-09-29 at 21 10 34

Once the query is running, users can send it to the background.

There's a new button in the applications query bar allowing to open a flyout with background searches.

CleanShot 2025-09-29 at 21 12 19

This button allows users to open completed background searches.

CleanShot 2025-09-29 at 21 12 45
  • Apart from this, this feature is a new version of the deprecated Search sessions.
  • Note that Background searches are not enabled by this PR in serverless, there's a follow up issue : [Background search] Enable Background search as default #236543
  • The disabled test suits need to be fixed and re-enabled for background search. issue will be created
  • Worth to to note that this is built on top of the integration work done by @AlexGPlay 🙏

Code changes

Removal of Background Search Feature Flag and Related Logic:

  • Deleted the BACKGROUND_SEARCH_FEATURE_FLAG_KEY constant and all code referencing the background search feature flag, including conditional logic and feature flag checks in search_interceptor.ts, search_service.ts, and related files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]
  • Removed documentation about the background search feature flag from kbn-background-search/README.md.

Messaging and Label Updates:

  • Updated user-facing messages and accessibility labels throughout the UI and tests to use "background search" terminology instead of "search session." [1] [2] [3] [4] [5] [6]

Codebase Cleanup and Simplification:

  • Removed unnecessary imports and code related to the feature flag, and simplified logic in search_service.ts, connected_search_session_indicator.tsx, and related files. [1] [2] [3] [4] [5] [6]

Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • 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.
@kertal kertal self-assigned this Sep 29, 2025
@kertal kertal added the Project:AsyncSearch Background search, partial results, async search services. label Sep 29, 2025
@kertal
Copy link
Member Author

kertal commented Sep 29, 2025

/ci

@kertal kertal requested a review from Copilot September 29, 2025 18:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request removes the background search feature flag and enables background search functionality by default across the Kibana codebase. The changes involve simplifying logic that previously depended on the feature flag and updating user-facing terminology from "search sessions" to "background search".

Key Changes:

  • Feature flag removal: Deleted all references to BACKGROUND_SEARCH_FEATURE_FLAG_KEY and related conditional logic throughout the search service implementation
  • Default enablement: Changed the search sessions configuration default from false to true and removed server arguments that explicitly enabled sessions in test configurations
  • Terminology updates: Updated labels, messages, and test descriptions to consistently use "background search" instead of "search session"

Reviewed Changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/platform/plugins/shared/data/server/config.ts Changed search sessions default from disabled to enabled
src/platform/plugins/shared/data/public/search/session/constants.ts Removed background search feature flag constant
src/platform/plugins/shared/data/public/search/search_service.ts Removed feature flag checks and simplified session indicator creation logic
src/platform/plugins/shared/data/public/search/search_interceptor/search_interceptor.ts Simplified toast messaging by removing feature flag conditionals
src/platform/plugins/shared/data/public/search/session/sessions_mgmt/lib/api.ts Removed feature flag checks from notification messages
Various test files Updated test descriptions and expected messages from "search sessions" to "background search"
Translation files Updated i18n strings to use "background search" terminology
Configuration files Removed feature flag server arguments from test configurations
Comments suppressed due to low confidence (1)

src/platform/plugins/shared/data/public/search/session/sessions_mgmt/components/table/actions/rename_button.tsx:1

  • The closing parenthesis and brace placement is incorrect. The aria-label assignment should end with just }) not })} since it's a template literal interpolation.
/*
kertal and others added 5 commits September 29, 2025 20:45
…_indicator/search_session_indicator/search_session_indicator.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…_indicator/search_session_indicator/search_session_indicator.stories.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kertal kertal added Feature:Discover Discover Application release_note:feature Makes this part of the condensed release notes backport:skip This PR does not require backporting labels Sep 29, 2025
@kertal kertal marked this pull request as ready for review September 29, 2025 19:34
@kertal kertal requested review from a team as code owners September 29, 2025 19:34
@kertal kertal requested a review from AlexGPlay September 29, 2025 19:43
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
data 518 506 -12

Async chunks

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

id before after diff
data 38.0KB 21.8KB -16.1KB
inspector 30.8KB 30.8KB +3.0B
total -16.1KB

Page load bundle

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

id before after diff
data 423.7KB 416.1KB -7.5KB
Unknown metric groups

async chunk count

id before after diff
data 5 4 -1

History

cc @kertal

chrome.setBreadcrumbsAppendExtension({
content: toMountPoint(
React.createElement(
createConnectedSearchSessionIndicator({
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add a task to clean up this code?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, we should add a task to generally clean up a lot of dead code 🥳

Copy link
Contributor

@AlexGPlay AlexGPlay left a comment

Choose a reason for hiding this comment

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

lgtm - we should add a task to later on clean up the dead code + fix the skipped tests

@kertal kertal added the Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// label Sep 30, 2025
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

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

LGTM! Rebranding "Search Sessions" into "Background Search"

Copy link
Contributor

@damian-polewski damian-polewski left a comment

Choose a reason for hiding this comment

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

kibana-management changes LGTM!

Copy link
Contributor

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

lgtm! code review

@kertal kertal merged commit 10e5a29 into elastic:main Sep 30, 2025
23 checks passed
@kertal kertal deleted the data-background-search-enable branch October 1, 2025 11:27
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
Enables sending searches to the background in Discover and Dashboard. Introducing the ability for users to send long-running searches to the background. In both Discover and Dashboard, the query bar’s “Refresh” button now includes a “Send to background” action. Once a search is running, users can offload it to the background, allowing them to continue working without waiting for the query to complete.

A new button in the query bar opens a flyout listing all completed background searches, making it easy to revisit and manage them.

This feature replaces the deprecated search sessions and removes the background search feature flag. 

Co-authored-by: Alex Garcia <alex.garcia@elastic.co>
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 needs_docs Project:AsyncSearch Background search, partial results, async search services. release_note:feature Makes this part of the condensed release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v9.2.0

10 participants