Skip to content

[Unified search] Display the solutions recommended queries in the help menu#223602

Merged
stratoula merged 18 commits intoelastic:mainfrom
stratoula:help-menu-recommended-queries
Jun 13, 2025
Merged

[Unified search] Display the solutions recommended queries in the help menu#223602
stratoula merged 18 commits intoelastic:mainfrom
stratoula:help-menu-recommended-queries

Conversation

@stratoula
Copy link
Contributor

@stratoula stratoula commented Jun 12, 2025

Summary

Reopening of #223362

In #221474 we introduced the mechanism to register queries per solution at the editor.

This PR displays these queries in the unified search menu too. In the following screenshot the 2 first queries are the oblt solution registered queries. I also have a max-height just to be sure that this list doesnt get too long now that the solutions can register queries.

image

Note

This change won't display anything in the popover as no solution has registered any queries yet. This PR sets the mechanism though on when they will do so.

How to test

If you want to test it the fastest way is to go to the esql plugin (server side) and add (change the examples as you wish):

this.extensionsRegistry.setRecommendedQueries(
      [
        {
          name: 'Logs count by log level',
          query: 'from logs* | STATS count(*) by log_level',
        },
        {
          name: 'Apache logs counts',
          query: 'from logs-apache_error | STATS count(*)',
        },
        {
          name: 'Another index, not logs',
          query: 'from movies | STATS count(*)',
        },
      ],
      'oblt'
    );

Then go to Discover (solutions mode) and type from logs* and hit the query. Open the popover and check the 2 first recommendations are been suggested.

Checklist

@stratoula stratoula changed the title Help menu recommended queries [Unified search] Display the solutions recommended queries in the help menu Jun 12, 2025
@stratoula stratoula added backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// v9.1.0 v8.19.0 labels Jun 12, 2025
@stratoula stratoula marked this pull request as ready for review June 12, 2025 16:23
@stratoula stratoula requested review from a team as code owners June 12, 2025 16:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@stratoula
Copy link
Contributor Author

I merged it by mistake and reverted it, so I open it again. ES|QL team had approved and was missing the team presentation review. @nreese had started it already here #223362 and I had addressed all his comments. Let me know if there is anyting else.

I am so sorry for the inconvenience. I did it by mistake.

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-presentation changes LGTM
code review only.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cloudSecurityPosture 704 705 +1
controls 355 356 +1
dashboard 669 670 +1
data 534 535 +1
datasetQuality 439 440 +1
dataVisualizer 760 761 +1
discover 1307 1308 +1
esql 236 237 +1
esqlDataGrid 437 438 +1
eventAnnotationListing 592 593 +1
infra 1468 1469 +1
lens 1437 1438 +1
lists 461 462 +1
maps 1282 1283 +1
ml 2406 2407 +1
observability 1304 1305 +1
observabilityAIAssistantApp 318 319 +1
securitySolution 7600 7601 +1
slo 1178 1179 +1
stackAlerts 290 291 +1
streamsApp 505 506 +1
triggersActionsUi 874 875 +1
unifiedSearch 395 396 +1
total +23

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/esql-types 44 45 +1
unifiedSearch 113 114 +1
total +2

Async chunks

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

id before after diff
esql 256.3KB 255.6KB -677.0B
unifiedSearch 360.9KB 361.8KB +940.0B
total +263.0B

Page load bundle

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

id before after diff
esql 8.8KB 9.2KB +382.0B
Unknown metric groups

API count

id before after diff
@kbn/esql-types 45 46 +1
@kbn/esql-validation-autocomplete 189 191 +2
unifiedSearch 151 152 +1
total +4

History

@stratoula stratoula merged commit 563abe2 into elastic:main Jun 13, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15626387413

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 223602

Questions ?

Please refer to the Backport tool documentation

iblancof pushed a commit to iblancof/kibana that referenced this pull request Jun 16, 2025
…p menu (elastic#223602)

## Summary

Reopening of elastic#223362

In elastic#221474 we introduced the
mechanism to register queries per solution at the editor.

This PR displays these queries in the unified search menu too. In the
following screenshot the 2 first queries are the oblt solution
registered queries. I also have a max-height just to be sure that this
list doesnt get too long now that the solutions can register queries.

<img width="439" alt="image"
src="https://github.com/user-attachments/assets/8ca48b8a-1880-42f3-944f-dd1fb012661f"
/>

### Note

This change won't display anything in the popover as no solution has
registered any queries yet. This PR sets the mechanism though on when
they will do so.

### How to test
If you want to test it the fastest way is to go to the esql plugin
(server side) and add (change the examples as you wish):

```
this.extensionsRegistry.setRecommendedQueries(
      [
        {
          name: 'Logs count by log level',
          query: 'from logs* | STATS count(*) by log_level',
        },
        {
          name: 'Apache logs counts',
          query: 'from logs-apache_error | STATS count(*)',
        },
        {
          name: 'Another index, not logs',
          query: 'from movies | STATS count(*)',
        },
      ],
      'oblt'
    );

```
Then go to Discover (solutions mode) and type `from logs*` and hit the
query. Open the popover and check the 2 first recommendations are been
suggested.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios





<!--ONMERGE {"backportTargets":["8.19"]} ONMERGE-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 223602 locally
cc: @stratoula

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 17, 2025
@stratoula
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

stratoula added a commit to stratoula/kibana that referenced this pull request Jun 17, 2025
…p menu (elastic#223602)

## Summary

Reopening of elastic#223362

In elastic#221474 we introduced the
mechanism to register queries per solution at the editor.

This PR displays these queries in the unified search menu too. In the
following screenshot the 2 first queries are the oblt solution
registered queries. I also have a max-height just to be sure that this
list doesnt get too long now that the solutions can register queries.

<img width="439" alt="image"
src="https://github.com/user-attachments/assets/8ca48b8a-1880-42f3-944f-dd1fb012661f"
/>

### Note

This change won't display anything in the popover as no solution has
registered any queries yet. This PR sets the mechanism though on when
they will do so.

### How to test
If you want to test it the fastest way is to go to the esql plugin
(server side) and add (change the examples as you wish):

```
this.extensionsRegistry.setRecommendedQueries(
      [
        {
          name: 'Logs count by log level',
          query: 'from logs* | STATS count(*) by log_level',
        },
        {
          name: 'Apache logs counts',
          query: 'from logs-apache_error | STATS count(*)',
        },
        {
          name: 'Another index, not logs',
          query: 'from movies | STATS count(*)',
        },
      ],
      'oblt'
    );

```
Then go to Discover (solutions mode) and type `from logs*` and hit the
query. Open the popover and check the 2 first recommendations are been
suggested.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

<!--ONMERGE {"backportTargets":["8.19"]} ONMERGE-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 563abe2)

# Conflicts:
#	src/platform/plugins/shared/unified_search/public/search_bar/search_bar.test.tsx
stratoula added a commit that referenced this pull request Jun 17, 2025
…the help menu (#223602) (#224174)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Unified search] Display the solutions recommended queries in the
help menu (#223602)](#223602)

<!--- Backport version: 10.0.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-06-13T04:22:45Z","message":"[Unified
search] Display the solutions recommended queries in the help menu
(#223602)\n\n## Summary\n\nReopening of
https://github.com/elastic/kibana/pull/223362\n\nIn
#221474 we introduced
the\nmechanism to register queries per solution at the editor.\n\nThis
PR displays these queries in the unified search menu too. In
the\nfollowing screenshot the 2 first queries are the oblt
solution\nregistered queries. I also have a max-height just to be sure
that this\nlist doesnt get too long now that the solutions can register
queries.\n\n<img width=\"439\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/8ca48b8a-1880-42f3-944f-dd1fb012661f\"\n/>\n\n###
Note\n\nThis change won't display anything in the popover as no solution
has\nregistered any queries yet. This PR sets the mechanism though on
when\nthey will do so.\n\n### How to test\nIf you want to test it the
fastest way is to go to the esql plugin\n(server side) and add (change
the examples as you
wish):\n\n```\nthis.extensionsRegistry.setRecommendedQueries(\n [\n {\n
name: 'Logs count by log level',\n query: 'from logs* | STATS count(*)
by log_level',\n },\n {\n name: 'Apache logs counts',\n query: 'from
logs-apache_error | STATS count(*)',\n },\n {\n name: 'Another index,
not logs',\n query: 'from movies | STATS count(*)',\n },\n ],\n 'oblt'\n
);\n\n```\nThen go to Discover (solutions mode) and type `from logs*`
and hit the\nquery. Open the popover and check the 2 first
recommendations are been\nsuggested.\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios\n\n\n\n\n\n\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"563abe2cac151f59162639658ba4a3017d15cfb1","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[Unified
search] Display the solutions recommended queries in the help
menu","number":223602,"url":"https://github.com/elastic/kibana/pull/223602","mergeCommit":{"message":"[Unified
search] Display the solutions recommended queries in the help menu
(#223602)\n\n## Summary\n\nReopening of
https://github.com/elastic/kibana/pull/223362\n\nIn
#221474 we introduced
the\nmechanism to register queries per solution at the editor.\n\nThis
PR displays these queries in the unified search menu too. In
the\nfollowing screenshot the 2 first queries are the oblt
solution\nregistered queries. I also have a max-height just to be sure
that this\nlist doesnt get too long now that the solutions can register
queries.\n\n<img width=\"439\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/8ca48b8a-1880-42f3-944f-dd1fb012661f\"\n/>\n\n###
Note\n\nThis change won't display anything in the popover as no solution
has\nregistered any queries yet. This PR sets the mechanism though on
when\nthey will do so.\n\n### How to test\nIf you want to test it the
fastest way is to go to the esql plugin\n(server side) and add (change
the examples as you
wish):\n\n```\nthis.extensionsRegistry.setRecommendedQueries(\n [\n {\n
name: 'Logs count by log level',\n query: 'from logs* | STATS count(*)
by log_level',\n },\n {\n name: 'Apache logs counts',\n query: 'from
logs-apache_error | STATS count(*)',\n },\n {\n name: 'Another index,
not logs',\n query: 'from movies | STATS count(*)',\n },\n ],\n 'oblt'\n
);\n\n```\nThen go to Discover (solutions mode) and type `from logs*`
and hit the\nquery. Open the popover and check the 2 first
recommendations are been\nsuggested.\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios\n\n\n\n\n\n\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"563abe2cac151f59162639658ba4a3017d15cfb1"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223602","number":223602,"mergeCommit":{"message":"[Unified
search] Display the solutions recommended queries in the help menu
(#223602)\n\n## Summary\n\nReopening of
https://github.com/elastic/kibana/pull/223362\n\nIn
#221474 we introduced
the\nmechanism to register queries per solution at the editor.\n\nThis
PR displays these queries in the unified search menu too. In
the\nfollowing screenshot the 2 first queries are the oblt
solution\nregistered queries. I also have a max-height just to be sure
that this\nlist doesnt get too long now that the solutions can register
queries.\n\n<img width=\"439\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/8ca48b8a-1880-42f3-944f-dd1fb012661f\"\n/>\n\n###
Note\n\nThis change won't display anything in the popover as no solution
has\nregistered any queries yet. This PR sets the mechanism though on
when\nthey will do so.\n\n### How to test\nIf you want to test it the
fastest way is to go to the esql plugin\n(server side) and add (change
the examples as you
wish):\n\n```\nthis.extensionsRegistry.setRecommendedQueries(\n [\n {\n
name: 'Logs count by log level',\n query: 'from logs* | STATS count(*)
by log_level',\n },\n {\n name: 'Apache logs counts',\n query: 'from
logs-apache_error | STATS count(*)',\n },\n {\n name: 'Another index,
not logs',\n query: 'from movies | STATS count(*)',\n },\n ],\n 'oblt'\n
);\n\n```\nThen go to Discover (solutions mode) and type `from logs*`
and hit the\nquery. Open the popover and check the 2 first
recommendations are been\nsuggested.\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios\n\n\n\n\n\n\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"563abe2cac151f59162639658ba4a3017d15cfb1"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes Team:ESQL ES|QL related features in Kibana t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants