Skip to content

[Meta] Search Sessions Roadmap #61738

@lizozom

Description

@lizozom

Part of https://github.com/elastic/dev/issues/1209

Search Sessions

A search session refers to running one or more ES searches in the background, in the context of a dashboard, or another application, allowing a user to come back and view the results later.

Proof of Concept

The POC PR includes a partial implementation of the Background Search feature, used for demo purposes. It also contains a sample plugin.

It should be reviewed and serve as a basis for the full implementation.

Tasks

(*) Means that the capability was implemented in the POC.

Improve search API

RFC

Client side BackgroundSession

#83640

Server side Background Session Service

  • (*) Implement server side background session service API (trackId / store / getId) [Search] Implement a background search service #61743
  • (*) Implement server side background session service monitoring loop that syncs tracked IDs to a saved objcet if a user decides to store the session.
  • Handle edge case of extending expiration of requests not generated by async search
  • Implement versioned updates (concurrency)
  • Don't allow adding new requests to a complete / error session

Monitoring service

Management

UI

Improvements

Misc

Flaky tests

Docs

keep_alive time

The ElasticSearch _async_search endpoint stores results of queries that ran longer than wait_for_completion_timeout by default.

The default keep_alive time is 5 days, and this includes both the query run time and store time. So if keep_alive is 5 days and the query ran for 4 days, it will be stored by default for another 1 day. If a query did not complete until the keep_alive time is reached - it will be canceled.

So while implementing this feature, it is important that Kibana doesn't store all queries for that time period. Storing queries for a long time is expensive in terms of both resources and cost. Instead, we should store the data for an initially short time, and then extend it, by sending a GET request to the same search ID, with a longer keep_alive.

Known limitations

  • Follow up searches - Some visualizations send additional searches based on the results of an initial search. For example, known examples are a pie chart with an Other bucket or a histogram based on the non default timefield.
    If we rely on the browser to track and store outgoing requests for a given background search, navigating away from the visualization before the secondary request was sent, will result in a partial background search that triggers an additional background search when opened.
    The solution to this seems to be supporting server side execution, but this maybe complex and time consuming.
    • ES support: When can we expect ES atomic handling of the two examples mentioned (pie charts, histogram)
    • Do Maps and TSVB have similar limitations?
  • TSVB does not use the existing search service. More over, it sends multiple requests from the server side. This might be resolved by making the search service available on the server side and using it from TSVB, or having TSVB use the _async_search API and return the search IDs somehow to the client.
  • Timelion won't be supported.
  • Completion notifications should be available to the user, regardless which application he's using ATM. This requires implementing a generic push notifications service (With Web Workers?). Maybe implemented in Phase 2.
  • Web Sockets - can we use them on cloud somehow?

Metadata

Metadata

Labels

Feature:SearchQuerying infrastructure in KibanaFeature:Search SessionsMetaTeam:DataDiscoveryDiscover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t//impact:lowAddressing this issue will have a low level of impact on the quality/strength of our product.loe:smallSmall Level of Effortv8.0.0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions