-
Notifications
You must be signed in to change notification settings - Fork 163
[Merge with serverless release - week of Oct 27] Docs for multi selection with ES|QL variable controls #3529
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
Open
florent-leborgne
wants to merge
5
commits into
elastic:main
Choose a base branch
from
florent-leborgne:esql-multi-values-controls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
007d92a
Docs for multi selection with ES|QL variable controls
florent-leborgne 575fbd8
link to ES mv_contains reference docs
florent-leborgne 10bc14b
I can't read a link properly
florent-leborgne b23ed67
Update explore-analyze/_snippets/multi-value-esql-controls.md
florent-leborgne 0f8bf2b
Suggestions from @benironside
florent-leborgne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
explore-analyze/_snippets/import-discover-query-controls-into-dashboard.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
You can create controls that let users select multiple values. To do that: | ||
|
||
1. Add the [`MV_CONTAINS`](elasticsearch://reference/query-languages/esql/functions-operators/mv-functions.md#esql-mv_contains) function to your query, and [create a variable](#add-variable-control) as one of the function parameters. For example: | ||
|
||
```esql | ||
FROM logs-* | WHERE MV_CONTAINS(?values, field) | ||
``` | ||
|
||
:::{note} | ||
Multi-selection is only available for `?values` variables. It is not available for `??fields` and `??functions` variables. | ||
::: | ||
|
||
2. When defining the control, select the **Allow multiple selections** option. | ||
|
||
3. Save the the control. | ||
florent-leborgne marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
The newly configured control becomes available and allows to select multiple values. | ||
florent-leborgne marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
1. While editing your {{esql}} query, the autocomplete menu suggests adding a control when relevant or when typing `?` in the query. Select **Create control**. | ||
florent-leborgne marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
2. A menu opens to let you configure the control. This is where you can specify: | ||
|
||
* The type of the control. | ||
* For controls with **Static values**, enter available controls manually or select them from the dropdown list. | ||
* For controls with **Values from a query**, write an {{esql}} query to populate the list of options. | ||
* The name of the control. This name is used to reference the control in {{esql}} queries. | ||
* Start the name with `?` if you want the options to be simple static values. | ||
* Start the name with `??` if you want the options to be fields or functions. {applies_to}`stack: ga 9.1` | ||
* The values users can select for this control. You can add multiple values from suggested fields, or type in custom values. If you selected **Values from a query**, you must instead write an {{esql}} query at this step. | ||
* The label of the control. This is the label displayed in **Discover** or in the dashboard. | ||
* The width of the control. | ||
florent-leborgne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Whether the control should allow selecting a single value or multiple values. This [requires using the `MV_CONTAINS` function in your query](#esql-multi-values-controls). {applies_to}`stack: preview 9.3` {applies_to}`serverless: preview` | ||
florent-leborgne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
 | ||
|
||
3. Save the control. | ||
|
||
The variable is inserted into your query, and the control appears. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-364 KB
(21%)
explore-analyze/images/esql-visualization-control-suggestion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.