diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/bucket.md b/docs/reference/query-languages/esql/_snippets/functions/examples/bucket.md index b5cbed477c2f2..13303d5e9e638 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/bucket.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/bucket.md @@ -14,7 +14,6 @@ For example, asking for at most 20 buckets over a year results in monthly bucket FROM employees | WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z" | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z") -| SORT hire_date ``` | hire_date:date | month:date | @@ -61,7 +60,6 @@ For example, asking for at most 100 buckets in a year results in weekly buckets: FROM employees | WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z" | STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z") -| SORT week ``` | hires_per_week:long | week:date | @@ -169,7 +167,6 @@ Create monthly buckets for the year 1985, and calculate the average salary by hi FROM employees | WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z" | STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z") -| SORT bucket ``` | AVG(salary):double | bucket:date | @@ -218,8 +215,6 @@ inserting a negative offset of `1 hour` to buckets of `1 year` looks like this: FROM employees | STATS dates = MV_SORT(VALUES(birth_date)) BY b = BUCKET(birth_date + 1 HOUR, 1 YEAR) - 1 HOUR | EVAL d_count = MV_COUNT(dates) -| SORT d_count, b -| LIMIT 3 ``` | dates:date | b:date | d_count:integer | diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/kql.md b/docs/reference/query-languages/esql/_snippets/functions/examples/kql.md index ea7a6399c6081..10e946f7c69a3 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/kql.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/kql.md @@ -5,9 +5,6 @@ ```esql FROM books | WHERE KQL("author: Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` | book_no:keyword | author:text | diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/left.md b/docs/reference/query-languages/esql/_snippets/functions/examples/left.md index 34014529f0334..7702c1fdfd16f 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/left.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/left.md @@ -6,8 +6,6 @@ FROM employees | KEEP last_name | EVAL left = LEFT(last_name, 3) -| SORT last_name ASC -| LIMIT 5 ``` | last_name:keyword | left:keyword | diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/match.md b/docs/reference/query-languages/esql/_snippets/functions/examples/match.md index 68f542546a0e5..21694aee454bc 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/match.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/match.md @@ -5,9 +5,6 @@ ```esql FROM books | WHERE MATCH(author, "Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` | book_no:keyword | author:text | diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/qstr.md b/docs/reference/query-languages/esql/_snippets/functions/examples/qstr.md index bbd6fbb05d799..d76f0ee79a828 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/qstr.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/qstr.md @@ -5,9 +5,6 @@ ```esql FROM books | WHERE QSTR("author: Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` | book_no:keyword | author:text | @@ -21,9 +18,6 @@ FROM books ```esql FROM books | WHERE QSTR("title: Hobbjt~", {"fuzziness": 2}) -| KEEP book_no, title -| SORT book_no -| LIMIT 5 ``` | book_no:keyword | title:text | diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/right.md b/docs/reference/query-languages/esql/_snippets/functions/examples/right.md index 26acfae39935b..665425aabfc2c 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/right.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/right.md @@ -6,8 +6,6 @@ FROM employees | KEEP last_name | EVAL right = RIGHT(last_name, 3) -| SORT last_name ASC -| LIMIT 5 ``` | last_name:keyword | right:keyword | diff --git a/docs/reference/query-languages/esql/_snippets/functions/examples/term.md b/docs/reference/query-languages/esql/_snippets/functions/examples/term.md index bebe560cef2d1..6e9265abc02e2 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/examples/term.md +++ b/docs/reference/query-languages/esql/_snippets/functions/examples/term.md @@ -5,8 +5,6 @@ ```esql FROM books | WHERE TERM(author, "gabriel") -| KEEP book_no, title -| LIMIT 3 ``` | book_no:keyword | title:text | diff --git a/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md b/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md index f27870719e979..94283c89b809b 100644 --- a/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md +++ b/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md @@ -5,9 +5,6 @@ ```esql FROM employees | WHERE birth_date IS NULL -| KEEP first_name, last_name -| SORT first_name -| LIMIT 3 ``` | first_name:keyword | last_name:keyword | diff --git a/docs/reference/query-languages/esql/_snippets/operators/examples/match_operator.md b/docs/reference/query-languages/esql/_snippets/operators/examples/match_operator.md index a3b3b5386d0c6..9fd7c5aab2a3d 100644 --- a/docs/reference/query-languages/esql/_snippets/operators/examples/match_operator.md +++ b/docs/reference/query-languages/esql/_snippets/operators/examples/match_operator.md @@ -5,9 +5,6 @@ ```esql FROM books | WHERE MATCH(author, "Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` | book_no:keyword | author:text | diff --git a/docs/reference/query-languages/esql/_snippets/operators/examples/predicates.md b/docs/reference/query-languages/esql/_snippets/operators/examples/predicates.md index 1e3c1cd49305c..aa1598c6c72b8 100644 --- a/docs/reference/query-languages/esql/_snippets/operators/examples/predicates.md +++ b/docs/reference/query-languages/esql/_snippets/operators/examples/predicates.md @@ -5,9 +5,6 @@ ```esql FROM employees | WHERE birth_date IS NULL -| KEEP first_name, last_name -| SORT first_name -| LIMIT 3 ``` | first_name:keyword | last_name:keyword | diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/bucket.json b/docs/reference/query-languages/esql/kibana/definition/functions/bucket.json index d70ffeec57204..d7f84e1d85190 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/bucket.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/bucket.json @@ -1590,16 +1590,16 @@ } ], "examples" : [ - "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date", + "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")", "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month", - "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week", + "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")", "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week", "FROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs", "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b", "FROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())", - "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket", + "FROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")", "FROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2", - "FROM employees\n| STATS dates = MV_SORT(VALUES(birth_date)) BY b = BUCKET(birth_date + 1 HOUR, 1 YEAR) - 1 HOUR\n| EVAL d_count = MV_COUNT(dates)\n| SORT d_count, b\n| LIMIT 3" + "FROM employees\n| STATS dates = MV_SORT(VALUES(birth_date)) BY b = BUCKET(birth_date + 1 HOUR, 1 YEAR) - 1 HOUR\n| EVAL d_count = MV_COUNT(dates)" ], "preview" : false, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/kql.json b/docs/reference/query-languages/esql/kibana/definition/functions/kql.json index f7748ef09455f..fa93a40c3b90d 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/kql.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/kql.json @@ -30,7 +30,7 @@ } ], "examples" : [ - "FROM books\n| WHERE KQL(\"author: Faulkner\")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5" + "FROM books\n| WHERE KQL(\"author: Faulkner\")" ], "preview" : true, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/left.json b/docs/reference/query-languages/esql/kibana/definition/functions/left.json index 1f1bce610f5ab..6565a8f22b6cb 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/left.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/left.json @@ -42,7 +42,7 @@ } ], "examples" : [ - "FROM employees\n| KEEP last_name\n| EVAL left = LEFT(last_name, 3)\n| SORT last_name ASC\n| LIMIT 5" + "FROM employees\n| KEEP last_name\n| EVAL left = LEFT(last_name, 3)" ], "preview" : false, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/match.json b/docs/reference/query-languages/esql/kibana/definition/functions/match.json index bad4974795f69..18048a9091550 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/match.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/match.json @@ -731,7 +731,7 @@ } ], "examples" : [ - "FROM books\n| WHERE MATCH(author, \"Faulkner\")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5", + "FROM books\n| WHERE MATCH(author, \"Faulkner\")", "FROM books\n| WHERE MATCH(title, \"Hobbit Back Again\", {\"operator\": \"AND\"})\n| KEEP title;" ], "preview" : true, diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json b/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json index 0c4f19d2dad0a..2507e4d073afd 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json @@ -44,8 +44,8 @@ } ], "examples" : [ - "FROM books\n| WHERE QSTR(\"author: Faulkner\")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5", - "FROM books\n| WHERE QSTR(\"title: Hobbjt~\", {\"fuzziness\": 2})\n| KEEP book_no, title\n| SORT book_no\n| LIMIT 5" + "FROM books\n| WHERE QSTR(\"author: Faulkner\")", + "FROM books\n| WHERE QSTR(\"title: Hobbjt~\", {\"fuzziness\": 2})" ], "preview" : true, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/right.json b/docs/reference/query-languages/esql/kibana/definition/functions/right.json index eb9e35c526348..726028f5e4b76 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/right.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/right.json @@ -42,7 +42,7 @@ } ], "examples" : [ - "FROM employees\n| KEEP last_name\n| EVAL right = RIGHT(last_name, 3)\n| SORT last_name ASC\n| LIMIT 5" + "FROM employees\n| KEEP last_name\n| EVAL right = RIGHT(last_name, 3)" ], "preview" : false, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/term.json b/docs/reference/query-languages/esql/kibana/definition/functions/term.json index 17ecff4943129..08c983b50b894 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/term.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/term.json @@ -78,7 +78,7 @@ } ], "examples" : [ - "FROM books\n| WHERE TERM(author, \"gabriel\")\n| KEEP book_no, title\n| LIMIT 3" + "FROM books\n| WHERE TERM(author, \"gabriel\")" ], "preview" : true, "snapshot_only" : true diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json index 0241fc9b1f79e..7e11a801f0818 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json @@ -187,7 +187,7 @@ } ], "examples" : [ - "FROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3" + "FROM employees\n| WHERE birth_date IS NULL" ], "preview" : false, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json b/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json index 37ec36d46f90b..7dbcf38a7f3d5 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/match_operator.json @@ -529,7 +529,7 @@ } ], "examples" : [ - "FROM books\n| WHERE MATCH(author, \"Faulkner\")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5" + "FROM books\n| WHERE MATCH(author, \"Faulkner\")" ], "preview" : true, "snapshot_only" : false diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json b/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json index 6c909368787ef..1620d567cba1a 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json @@ -187,7 +187,7 @@ } ], "examples" : [ - "FROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3", + "FROM employees\n| WHERE birth_date IS NULL", "FROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS COUNT(emp_no)" ], "preview" : false, diff --git a/docs/reference/query-languages/esql/kibana/docs/functions/bucket.md b/docs/reference/query-languages/esql/kibana/docs/functions/bucket.md index c7e2f48fe3f9e..cea3272a58a80 100644 --- a/docs/reference/query-languages/esql/kibana/docs/functions/bucket.md +++ b/docs/reference/query-languages/esql/kibana/docs/functions/bucket.md @@ -10,5 +10,4 @@ The size of the buckets can either be provided directly, or chosen based on a re FROM employees | WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z" | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z") -| SORT hire_date ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/functions/kql.md b/docs/reference/query-languages/esql/kibana/docs/functions/kql.md index 61f1ceb20ea2a..112a13f36540f 100644 --- a/docs/reference/query-languages/esql/kibana/docs/functions/kql.md +++ b/docs/reference/query-languages/esql/kibana/docs/functions/kql.md @@ -8,7 +8,4 @@ Performs a KQL query. Returns true if the provided KQL query string matches the ```esql FROM books | WHERE KQL("author: Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/functions/left.md b/docs/reference/query-languages/esql/kibana/docs/functions/left.md index 002e5db559bee..10b4b0fcf90eb 100644 --- a/docs/reference/query-languages/esql/kibana/docs/functions/left.md +++ b/docs/reference/query-languages/esql/kibana/docs/functions/left.md @@ -9,6 +9,4 @@ Returns the substring that extracts *length* chars from *string* starting from t FROM employees | KEEP last_name | EVAL left = LEFT(last_name, 3) -| SORT last_name ASC -| LIMIT 5 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/functions/match.md b/docs/reference/query-languages/esql/kibana/docs/functions/match.md index 1e4bb6ef60321..bf30c6dfea067 100644 --- a/docs/reference/query-languages/esql/kibana/docs/functions/match.md +++ b/docs/reference/query-languages/esql/kibana/docs/functions/match.md @@ -19,7 +19,4 @@ For a simplified syntax, you can use the [match operator](https://www.elastic.co ```esql FROM books | WHERE MATCH(author, "Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/functions/qstr.md b/docs/reference/query-languages/esql/kibana/docs/functions/qstr.md index 331c90b03e465..b2cc44491ec22 100644 --- a/docs/reference/query-languages/esql/kibana/docs/functions/qstr.md +++ b/docs/reference/query-languages/esql/kibana/docs/functions/qstr.md @@ -8,7 +8,4 @@ Performs a [query string query](https://www.elastic.co/docs/reference/elasticsea ```esql FROM books | WHERE QSTR("author: Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/functions/right.md b/docs/reference/query-languages/esql/kibana/docs/functions/right.md index 24d4949090be4..43759a22f0308 100644 --- a/docs/reference/query-languages/esql/kibana/docs/functions/right.md +++ b/docs/reference/query-languages/esql/kibana/docs/functions/right.md @@ -9,6 +9,4 @@ Return the substring that extracts *length* chars from *str* starting from the r FROM employees | KEEP last_name | EVAL right = RIGHT(last_name, 3) -| SORT last_name ASC -| LIMIT 5 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/functions/term.md b/docs/reference/query-languages/esql/kibana/docs/functions/term.md index d28ef2d8f5567..9c4efb2a29fa4 100644 --- a/docs/reference/query-languages/esql/kibana/docs/functions/term.md +++ b/docs/reference/query-languages/esql/kibana/docs/functions/term.md @@ -8,6 +8,4 @@ Performs a Term query on the specified field. Returns true if the provided term ```esql FROM books | WHERE TERM(author, "gabriel") -| KEEP book_no, title -| LIMIT 3 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md index d6258ea91881d..88f719877aa1c 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md @@ -8,7 +8,4 @@ Use `IS NULL` to filter data based on whether the field exists or not. ```esql FROM employees | WHERE birth_date IS NULL -| KEEP first_name, last_name -| SORT first_name -| LIMIT 3 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/match_operator.md b/docs/reference/query-languages/esql/kibana/docs/operators/match_operator.md index 9b5a34c2a8780..847f5262d3004 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/match_operator.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/match_operator.md @@ -16,7 +16,4 @@ For using the function syntax, or adding [match query parameters](https://www.el ```esql FROM books | WHERE MATCH(author, "Faulkner") -| KEEP book_no, author -| SORT book_no -| LIMIT 5 ``` diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md b/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md index 00d3790cd79d9..2ae6d49936cc9 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md @@ -8,7 +8,4 @@ For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates. ```esql FROM employees | WHERE birth_date IS NULL -| KEEP first_name, last_name -| SORT first_name -| LIMIT 3 ``` diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/bucket.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/bucket.csv-spec index 8cfde2bb9bde7..cc461413638dd 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/bucket.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/bucket.csv-spec @@ -130,8 +130,8 @@ bucketMonthInAgg#[skip:-8.13.99, reason:BUCKET renamed in 8.14] FROM employees | WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z" | STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z") -| SORT bucket // end::bucket_in_agg[] +| SORT bucket ; // tag::bucket_in_agg-result[] @@ -150,9 +150,9 @@ bucketWithOffset#[skip:-8.13.99, reason:BUCKET renamed in 8.14] FROM employees | STATS dates = MV_SORT(VALUES(birth_date)) BY b = BUCKET(birth_date + 1 HOUR, 1 YEAR) - 1 HOUR | EVAL d_count = MV_COUNT(dates) +// end::bucketWithOffset[] | SORT d_count, b | LIMIT 3 -// end::bucketWithOffset[] ; // tag::bucketWithOffset-result[] @@ -168,8 +168,8 @@ docsBucketMonth#[skip:-8.13.99, reason:BUCKET renamed in 8.14] FROM employees | WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z" | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z") -| SORT hire_date //end::docsBucketMonth[] +| SORT hire_date ; //tag::docsBucketMonth-result[] @@ -208,8 +208,8 @@ docsBucketWeeklyHistogram#[skip:-8.13.99, reason:BUCKET renamed in 8.14] FROM employees | WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z" | STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z") -| SORT week //end::docsBucketWeeklyHistogram[] +| SORT week ; //tag::docsBucketWeeklyHistogram-result[] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/inlinestats.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/inlinestats.csv-spec index 7b64ee6b1c938..051173b7b94b7 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/inlinestats.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/inlinestats.csv-spec @@ -9,9 +9,9 @@ FROM employees | KEEP emp_no, languages | INLINESTATS max_lang = MAX(languages) | WHERE max_lang == languages +// end::max-languages[] | SORT emp_no ASC | LIMIT 5 -// end::max-languages[] ; // tag::max-languages-result[] @@ -78,9 +78,9 @@ FROM employees | KEEP emp_no, avg_worked_seconds, last_name | INLINESTATS max_avg_worked_seconds = MAX(avg_worked_seconds) BY SUBSTRING(last_name, 0, 1) | WHERE max_avg_worked_seconds == avg_worked_seconds +// end::longest-tenured-by-first[] | SORT last_name ASC | LIMIT 5 -// end::longest-tenured-by-first[] ; // tag::longest-tenured-by-first-result[] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/kql-function.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/kql-function.csv-spec index 1a376a671762d..bcb32daa34660 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/kql-function.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/kql-function.csv-spec @@ -8,10 +8,10 @@ required_capability: kql_function // tag::kql-with-field[] FROM books | WHERE KQL("author: Faulkner") +// end::kql-with-field[] | KEEP book_no, author | SORT book_no | LIMIT 5 -// end::kql-with-field[] ; // tag::kql-with-field-result[] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-function.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-function.csv-spec index d3b113870f153..32d180c5ccc9e 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-function.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-function.csv-spec @@ -8,10 +8,10 @@ required_capability: match_function // tag::match-with-field[] FROM books | WHERE MATCH(author, "Faulkner") +// end::match-with-field[] | KEEP book_no, author | SORT book_no | LIMIT 5 -// end::match-with-field[] ; // tag::match-with-field-result[] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-operator.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-operator.csv-spec index bf27ee0d33167..420225407d917 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-operator.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-operator.csv-spec @@ -8,10 +8,10 @@ required_capability: match_operator_colon // tag::match-with-field[] FROM books | WHERE author:"Faulkner" +// end::match-with-field[] | KEEP book_no, author | SORT book_no | LIMIT 5 -// end::match-with-field[] ; // tag::match-with-field-result[] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/null.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/null.csv-spec index 7bf3bc7613e01..2be656020811f 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/null.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/null.csv-spec @@ -28,10 +28,10 @@ isNullForDocs // tag::is-null[] FROM employees | WHERE birth_date IS NULL +// end::is-null[] | KEEP first_name, last_name | SORT first_name | LIMIT 3 -// end::is-null[] ; // tag::is-null-result[] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/qstr-function.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/qstr-function.csv-spec index 3abed3b545ad5..1bce0d7bfcbc6 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/qstr-function.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/qstr-function.csv-spec @@ -8,10 +8,10 @@ required_capability: qstr_function // tag::qstr-with-field[] FROM books | WHERE QSTR("author: Faulkner") +// end::qstr-with-field[] | KEEP book_no, author | SORT book_no | LIMIT 5 -// end::qstr-with-field[] ; // tag::qstr-with-field-result[] @@ -196,10 +196,10 @@ required_capability: query_string_function_options // tag::qstr-with-options[] FROM books | WHERE QSTR("title: Hobbjt~", {"fuzziness": 2}) +// end::qstr-with-options[] | KEEP book_no, title | SORT book_no | LIMIT 5 -// end::qstr-with-options[] ; ignoreOrder: true diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/string.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/string.csv-spec index cee1d5c512715..f291df4c3e4dc 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/string.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/string.csv-spec @@ -1133,9 +1133,9 @@ left FROM employees | KEEP last_name | EVAL left = LEFT(last_name, 3) +// end::left[] | SORT last_name ASC | LIMIT 5 -// end::left[] ; // tag::left-result[] @@ -1153,9 +1153,9 @@ right FROM employees | KEEP last_name | EVAL right = RIGHT(last_name, 3) +// end::right[] | SORT last_name ASC | LIMIT 5 -// end::right[] ; // tag::right-result[] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/term-function.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/term-function.csv-spec index a0af82fd3c64e..836e6f29f7e56 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/term-function.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/term-function.csv-spec @@ -8,9 +8,9 @@ required_capability: term_function // tag::term-with-field[] FROM books | WHERE TERM(author, "gabriel") +// end::term-with-field[] | KEEP book_no, title | LIMIT 3 -// end::term-with-field[] ; ignoreOrder:true