Skip to content
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

Discover fetches date histogram even when no documents match the query #198456

Closed
lukasolson opened this issue Oct 30, 2024 · 4 comments
Closed
Labels
bug Fixes for quality problems that affect the customer experience Feature:UnifiedHistogram Issues related to the Unified Histogram plugin impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@lukasolson
Copy link
Member

Describe the bug:

The unified histogram fetches the date histogram even when there are no results.

Steps to reproduce:

  1. Open Discover
  2. Use a query that produces no results
  3. Notice that two queries are made - one for the documents & one for the histogram

Ironically, if you refresh the entire browser, only one request is made (for the documents). But each time you click the "refresh" button, you get two additional queries.

Expected behavior:

Only one query for the documents.

Screenshots (if relevant):

Screen.Recording.2024-10-30.at.4.34.44.PM.mov

Any additional context:

Probably related to #165192.

@lukasolson lukasolson added bug Fixes for quality problems that affect the customer experience Feature:UnifiedHistogram Issues related to the Unified Histogram plugin impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Oct 30, 2024
@elasticmachine
Copy link
Contributor

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

@jughosta
Copy link
Contributor

Agree, this might be not ideal but I think it's working as expected. We make requests not in a sequence but in parallel to render the content as soon as we get the response for either the table or the histogram.

@kertal
Copy link
Member

kertal commented Nov 4, 2024

@jughosta is right, it's working as expected. The aim was to execute those queries in parallel to show results ASAP. Closing therefore

@kertal kertal closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
@lukasolson
Copy link
Member Author

Talked with @davismcphee about this one to make sure I understood what was happening - I was confused that when you load Discover from scratch, we only ever got one request for the documents. It seems there's an (intentional) race condition, and when you load Discover, by the time Lens loads, we already have the response from the documents query, so we don't run the histogram query, but when you just click "refresh" it makes both requests in parallel, and cancels the histogram query if the documents query comes back empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:UnifiedHistogram Issues related to the Unified Histogram plugin impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

No branches or pull requests

4 participants