diff --git a/explore-analyze/images/console-esql-autocomplete.png b/explore-analyze/images/console-esql-autocomplete.png new file mode 100644 index 0000000000..70a6881b09 Binary files /dev/null and b/explore-analyze/images/console-esql-autocomplete.png differ diff --git a/explore-analyze/query-filter/_snippets/console-esql-autocomplete.md b/explore-analyze/query-filter/_snippets/console-esql-autocomplete.md new file mode 100644 index 0000000000..bc4cc10385 --- /dev/null +++ b/explore-analyze/query-filter/_snippets/console-esql-autocomplete.md @@ -0,0 +1,5 @@ +{applies_to}`stack: ga 9.1` Inside quotes, Console suggests possible commands and functions to autocomplete your query: + +:::{image} /explore-analyze/images/console-esql-autocomplete.png +:alt: Console shows ES|QL autocomplete suggestions +::: \ No newline at end of file diff --git a/explore-analyze/query-filter/_snippets/discover-esql-autocomplete.md b/explore-analyze/query-filter/_snippets/discover-esql-autocomplete.md new file mode 100644 index 0000000000..c8088872f9 --- /dev/null +++ b/explore-analyze/query-filter/_snippets/discover-esql-autocomplete.md @@ -0,0 +1,5 @@ +Discover suggests possible commands and functions to autocomplete your query: + +:::{image} /explore-analyze/images/elasticsearch-reference-esql-kibana-auto-complete.png +:alt: esql kibana auto complete +::: \ No newline at end of file diff --git a/explore-analyze/query-filter/languages/esql-getting-started.md b/explore-analyze/query-filter/languages/esql-getting-started.md index 2b944998f1..daa2521477 100644 --- a/explore-analyze/query-filter/languages/esql-getting-started.md +++ b/explore-analyze/query-filter/languages/esql-getting-started.md @@ -87,10 +87,13 @@ Enter the actual {{esql}} query between the two sets of triple quotes. For examp POST /_query?format=txt { "query": """ -FROM sample_data +FROM kibana_sample_data_logs """ } ``` +:::{include} /explore-analyze/query-filter/_snippets/console-esql-autocomplete.md +::: + :::::: ::::::{tab-item} Discover @@ -100,10 +103,7 @@ Adjust the time filter so it includes the timestamps in the sample data (October After switching to {{esql}} mode, the query bar shows a sample query. You can replace this query with the queries in this getting started guide. -To make it easier to write queries, auto-complete offers suggestions with possible commands and functions: - -:::{image} /explore-analyze/images/elasticsearch-reference-esql-kibana-auto-complete.png -:alt: esql kibana auto complete +:::{include} /explore-analyze/query-filter/_snippets/discover-esql-autocomplete.md ::: You can adjust the editor’s height by dragging its bottom border to your liking. diff --git a/explore-analyze/query-filter/languages/esql-kibana.md b/explore-analyze/query-filter/languages/esql-kibana.md index fd892e42ac..128fb9d8aa 100644 --- a/explore-analyze/query-filter/languages/esql-kibana.md +++ b/explore-analyze/query-filter/languages/esql-kibana.md @@ -52,11 +52,7 @@ A source command can be followed by one or more [processing commands](elasticsea Click the **ES|QL help** button to open the in-product reference documentation for all commands and functions or to get recommended queries that will help you get started. :::: - -To make it easier to write queries, auto-complete offers suggestions with possible commands and functions: - -:::{image} /explore-analyze/images/elasticsearch-reference-esql-kibana-auto-complete.png -:alt: esql kibana auto complete +:::{include} /explore-analyze/query-filter/_snippets/discover-esql-autocomplete.md ::: ::::{note} @@ -279,7 +275,7 @@ You can also [Add dashboard controls from your ES|QL visualization's query](/exp ## Create an enrich policy [esql-kibana-enrich] -The {{esql}} [`ENRICH`](elasticsearch://reference/query-languages/esql/commands/processing-commands.md#esql-enrich) command enables you to [enrich](elasticsearch://reference/query-languages/esql/esql-enrich-data.md) your query dataset with fields from another dataset. Before you can use `ENRICH`, you need to [create and execute an enrich policy](elasticsearch://reference/query-languages/esql/esql-enrich-data.md#esql-set-up-enrich-policy). If a policy exists, it will be suggested by auto-complete. If not, click **Click to create** to create one. +The {{esql}} [`ENRICH`](elasticsearch://reference/query-languages/esql/commands/processing-commands.md#esql-enrich) command enables you to [enrich](elasticsearch://reference/query-languages/esql/esql-enrich-data.md) your query dataset with fields from another dataset. Before you can use `ENRICH`, you need to [create and execute an enrich policy](elasticsearch://reference/query-languages/esql/esql-enrich-data.md#esql-set-up-enrich-policy). If a policy exists, it will be suggested by autocomplete. If not, click **Click to create** to create one. :::{image} /explore-analyze/images/elasticsearch-reference-esql-kibana-enrich-autocomplete.png :alt: esql kibana enrich autocomplete diff --git a/explore-analyze/query-filter/languages/esql-rest.md b/explore-analyze/query-filter/languages/esql-rest.md index 6f8e437d02..1b4a8ba479 100644 --- a/explore-analyze/query-filter/languages/esql-rest.md +++ b/explore-analyze/query-filter/languages/esql-rest.md @@ -39,9 +39,9 @@ James S.A. Corey |Leviathan Wakes |561 |2011-06-02T00:00:00.000Z ``` -### Kibana Console [esql-kibana-console] +### Run the {{esql}} query API in Console [esql-kibana-console] -If you are using [Kibana Console](/explore-analyze/query-filter/tools/console.md) (which is highly recommended), take advantage of the triple quotes `"""` when creating the query. This not only automatically escapes double quotes (`"`) inside the query string but also supports multi-line requests: +We recommend using [Console](/explore-analyze/query-filter/tools/console.md) to run the {{esql}} query API. When creating the query, using triple quotes (`"""`) allows you to use special characters like quotes (`"`) without having to escape them. They also make it easier to write multi-line requests: ```console POST /_query?format=txt @@ -54,7 +54,8 @@ POST /_query?format=txt """ } ``` - +:::{include} /explore-analyze/query-filter/_snippets/console-esql-autocomplete.md +::: ### Response formats [esql-rest-format] diff --git a/explore-analyze/query-filter/tools/console.md b/explore-analyze/query-filter/tools/console.md index 8f772db55f..dfa17dcda2 100644 --- a/explore-analyze/query-filter/tools/console.md +++ b/explore-analyze/query-filter/tools/console.md @@ -15,8 +15,6 @@ products: # Run API requests with Console [console-kibana] -$$$configuring-console$$$ - $$$import-export-console-requests$$$ @@ -72,7 +70,7 @@ GET kbn:/api/index_management/indices When you’re typing a command, **Console** makes context-sensitive suggestions. These suggestions show you the parameters for each API and speed up your typing. -You can configure your preferences for autocomplete in the [Console settings](../../../explore-analyze/query-filter/tools/console.md#configuring-console). +You can configure your preferences for autocomplete in the [Console settings](#configuring-console). ### Comments [console-comments]