[ML] Displays document count chart for ES|QL categorize queries#231459
Conversation
|
Pinging @elastic/ml-ui (:ml) |
rbrtj
left a comment
There was a problem hiding this comment.
LGTM, just a heads up, if no timestamp is found, the histogram won't be shown. Previously, it was always displayed with the pattern count, but that's okay, I guess
|
The fact that we are not suggesting anything now if there is no @timestamp in the source seems a bit concerning to me. What we could do is on the recommendations to also suggest the time params (which enable the time picker for sources without the @timestamp field. So this instead of Of course the users now need to know that. Maybe the recommendation is a good training point but still. It is a business decision after all. But at least let's suggest it on the recommendations |
There was a problem hiding this comment.
Pull Request Overview
This PR improves the chart rendering for ES|QL categorize queries by showing a simple document count histogram instead of the count of all patterns. The change ensures that categorize queries display more meaningful chart visualizations.
Key changes:
- Modified the chart query detection to override categorize queries with a document count chart
- Fixed array indexing for the categorize field extraction
- Removed unused visualization attribute modifications and imports
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/platform/plugins/shared/discover/public/context_awareness/profile_providers/common/patterns/profile.ts |
Fixes array indexing for categorize field and removes unused visualization modifications |
src/platform/packages/shared/kbn-unified-histogram/services/lens_vis_service.ts |
Adds categorize query detection and document count chart override logic |
I've added this change. It adds |
peteharverson
left a comment
There was a problem hiding this comment.
LGTM, using the edits to the recommended query with the start / end params.
The document count chart provides a better UX than the current bar chart - consistency with the chart displayed for other queries, with ability to zoom in to time ranges on the chart. This will also pave the way for showing how the doc counts for a pattern compare to the baseline in future enhancements.
stratoula
left a comment
There was a problem hiding this comment.
ES|QL changes LGTM, code review only
| availableSuggestionsWithType.push({ | ||
| suggestion: histogramSuggestionForESQL, | ||
| type: UnifiedHistogramSuggestionType.histogramForESQL, | ||
| }); |
There was a problem hiding this comment.
| availableSuggestionsWithType.push({ | |
| suggestion: histogramSuggestionForESQL, | |
| type: UnifiedHistogramSuggestionType.histogramForESQL, | |
| }); | |
| if (histogramSuggestionForESQL) { | |
| availableSuggestionsWithType.push({ | |
| suggestion: histogramSuggestionForESQL, | |
| type: UnifiedHistogramSuggestionType.histogramForESQL, | |
| }); | |
| } |
can we additionally check that it returned a valid suggestion?
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
|
jughosta
left a comment
There was a problem hiding this comment.
Data Discovery changes LGTM - code review only
…31459) Overrides the chart query when a categorize query is detected so that it renders a simple doc count rather than the count of all patterns. <img width="1438" height="1101" alt="image" src="https://github.com/user-attachments/assets/08874499-d358-4045-a65b-9004c5330fb1" />
Overrides the chart query when a categorize query is detected so that it renders a simple doc count rather than the count of all patterns. <img width="1438" height="1101" alt="image" src="https://github.com/user-attachments/assets/08874499-d358-4045-a65b-9004c5330fb1" />
…31459) Overrides the chart query when a categorize query is detected so that it renders a simple doc count rather than the count of all patterns. <img width="1438" height="1101" alt="image" src="https://github.com/user-attachments/assets/08874499-d358-4045-a65b-9004c5330fb1" />
Overrides the chart query when a categorize query is detected so that it renders a simple doc count rather than the count of all patterns.