From 7b263b4b83ec612ff6295bf444b718ca32fce141 Mon Sep 17 00:00:00 2001 From: Craig Taverner Date: Tue, 1 Apr 2025 15:46:24 +0200 Subject: [PATCH] Kibana updates, remove links from JSON and split is-null/is-not-null (#125986) In particular: * Remove all links (both asciidoc and markdown) from the JSON definition files. * This required a two phase edit, from asciidoc links to markdown, and then removal of markdown (replace with markdown text). This is because the asciidoc does not have the display text, and because some links were already markdown. * Split predicates into is_null and is_not_null * We kept the old combined version because the main docs still use that, so now we have both combined and separate versions, and Kibana can select the version they want. --- .../operators/examples/is_not_null.md | 15 ++ .../_snippets/operators/examples/is_null.md | 19 ++ .../_snippets/operators/types/is_not_null.md | 22 ++ .../esql/_snippets/operators/types/is_null.md | 22 ++ .../esql/images/operators/is_not_null.svg | 1 + .../esql/images/operators/is_null.svg | 1 + .../kibana/definition/functions/greatest.json | 2 +- .../kibana/definition/functions/least.json | 2 +- .../kibana/definition/functions/match.json | 2 +- .../kibana/definition/functions/median.json | 4 +- .../functions/median_absolute_deviation.json | 2 +- .../kibana/definition/functions/mv_first.json | 2 +- .../kibana/definition/functions/mv_last.json | 2 +- .../kibana/definition/functions/mv_slice.json | 2 +- .../kibana/definition/functions/qstr.json | 2 +- .../definition/functions/st_contains.json | 2 +- .../definition/functions/st_disjoint.json | 2 +- .../definition/functions/st_intersects.json | 2 +- .../definition/functions/st_within.json | 2 +- .../esql/kibana/definition/functions/tau.json | 2 +- .../functions/to_cartesianpoint.json | 2 +- .../functions/to_cartesianshape.json | 2 +- .../definition/functions/to_datetime.json | 2 +- .../definition/functions/to_geopoint.json | 2 +- .../definition/functions/to_geoshape.json | 2 +- .../kibana/definition/functions/values.json | 2 +- .../esql/kibana/definition/operators/add.json | 2 +- .../kibana/definition/operators/cast.json | 2 +- .../esql/kibana/definition/operators/div.json | 4 +- .../kibana/definition/operators/equals.json | 4 +- .../definition/operators/greater_than.json | 4 +- .../operators/greater_than_or_equal.json | 4 +- .../definition/operators/is_not_null.json | 194 ++++++++++++++++++ .../kibana/definition/operators/is_null.json | 194 ++++++++++++++++++ .../definition/operators/less_than.json | 4 +- .../operators/less_than_or_equal.json | 4 +- .../definition/operators/match_operator.json | 2 +- .../esql/kibana/definition/operators/mod.json | 2 +- .../esql/kibana/definition/operators/mul.json | 2 +- .../definition/operators/not rlike.json | 2 +- .../definition/operators/not_equals.json | 4 +- .../definition/operators/predicates.json | 2 +- .../kibana/definition/operators/rlike.json | 2 +- .../esql/kibana/definition/operators/sub.json | 2 +- .../esql/kibana/docs/operators/is_not_null.md | 12 ++ .../esql/kibana/docs/operators/is_null.md | 14 ++ .../esql/kibana/docs/operators/predicates.md | 2 +- .../expression/function/DocsV3Support.java | 5 +- .../operator/NullPredicatesTests.java | 105 +++++++++- 49 files changed, 638 insertions(+), 56 deletions(-) create mode 100644 docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md create mode 100644 docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md create mode 100644 docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md create mode 100644 docs/reference/query-languages/esql/_snippets/operators/types/is_null.md create mode 100644 docs/reference/query-languages/esql/images/operators/is_not_null.svg create mode 100644 docs/reference/query-languages/esql/images/operators/is_null.svg create mode 100644 docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json create mode 100644 docs/reference/query-languages/esql/kibana/definition/operators/is_null.json create mode 100644 docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md create mode 100644 docs/reference/query-languages/esql/kibana/docs/operators/is_null.md diff --git a/docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md b/docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md new file mode 100644 index 000000000000..c3b5e1fff6ac --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/examples/is_not_null.md @@ -0,0 +1,15 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Example** + +```esql +FROM employees +| WHERE is_rehired IS NOT NULL +| STATS COUNT(emp_no) +``` + +| COUNT(emp_no):long | +| --- | +| 84 | + + 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 new file mode 100644 index 000000000000..f27870719e97 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/examples/is_null.md @@ -0,0 +1,19 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Example** + +```esql +FROM employees +| WHERE birth_date IS NULL +| KEEP first_name, last_name +| SORT first_name +| LIMIT 3 +``` + +| first_name:keyword | last_name:keyword | +| --- | --- | +| Basil | Tramer | +| Florian | Syrotiuk | +| Lucien | Rosenbaum | + + diff --git a/docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md b/docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md new file mode 100644 index 000000000000..986c99c3cb45 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/types/is_not_null.md @@ -0,0 +1,22 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Supported types** + +| field | result | +| --- | --- | +| boolean | boolean | +| cartesian_point | boolean | +| cartesian_shape | boolean | +| date | boolean | +| date_nanos | boolean | +| double | boolean | +| geo_point | boolean | +| geo_shape | boolean | +| integer | boolean | +| ip | boolean | +| keyword | boolean | +| long | boolean | +| text | boolean | +| unsigned_long | boolean | +| version | boolean | + diff --git a/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md b/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md new file mode 100644 index 000000000000..986c99c3cb45 --- /dev/null +++ b/docs/reference/query-languages/esql/_snippets/operators/types/is_null.md @@ -0,0 +1,22 @@ +% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. + +**Supported types** + +| field | result | +| --- | --- | +| boolean | boolean | +| cartesian_point | boolean | +| cartesian_shape | boolean | +| date | boolean | +| date_nanos | boolean | +| double | boolean | +| geo_point | boolean | +| geo_shape | boolean | +| integer | boolean | +| ip | boolean | +| keyword | boolean | +| long | boolean | +| text | boolean | +| unsigned_long | boolean | +| version | boolean | + diff --git a/docs/reference/query-languages/esql/images/operators/is_not_null.svg b/docs/reference/query-languages/esql/images/operators/is_not_null.svg new file mode 100644 index 000000000000..1829ec7bdb9d --- /dev/null +++ b/docs/reference/query-languages/esql/images/operators/is_not_null.svg @@ -0,0 +1 @@ +IS NOT NULLv \ No newline at end of file diff --git a/docs/reference/query-languages/esql/images/operators/is_null.svg b/docs/reference/query-languages/esql/images/operators/is_null.svg new file mode 100644 index 000000000000..1a632b5e4911 --- /dev/null +++ b/docs/reference/query-languages/esql/images/operators/is_null.svg @@ -0,0 +1 @@ +IS NULLv \ No newline at end of file diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json b/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json index 0c095018d56f..cf7ebcf603e2 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/greatest.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "greatest", - "description" : "Returns the maximum value from multiple columns. This is similar to <>\nexcept it is intended to run on multiple columns at once.", + "description" : "Returns the maximum value from multiple columns. This is similar to `MV_MAX`\nexcept it is intended to run on multiple columns at once.", "note" : "When run on `keyword` or `text` fields, this returns the last string in alphabetical order. When run on `boolean` columns this will return `true` if any values are `true`.", "signatures" : [ { diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/least.json b/docs/reference/query-languages/esql/kibana/definition/functions/least.json index 42ad9b567e4c..d5ede3b84223 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/least.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/least.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "least", - "description" : "Returns the minimum value from multiple columns. This is similar to <> except it is intended to run on multiple columns at once.", + "description" : "Returns the minimum value from multiple columns. This is similar to `MV_MIN` except it is intended to run on multiple columns at once.", "signatures" : [ { "params" : [ 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 f455097b206d..bad4974795f6 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/match.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/match.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "match", - "description" : "Use `MATCH` to perform a <> on the specified field.\nUsing `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nMatch can be used on fields from the text family like <> and <>,\nas well as other field types like keyword, boolean, dates, and numeric types.\n\nMatch can use <> to specify additional options for the match query.\nAll <> are supported.\n\nFor a simplified syntax, you can use the <> `:` operator instead of `MATCH`.\n\n`MATCH` returns true if the provided query matches the row.", + "description" : "Use `MATCH` to perform a match query on the specified field.\nUsing `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nMatch can be used on fields from the text family like text and semantic_text,\nas well as other field types like keyword, boolean, dates, and numeric types.\n\nMatch can use function named parameters to specify additional options for the match query.\nAll match query parameters are supported.\n\nFor a simplified syntax, you can use the match operator `:` operator instead of `MATCH`.\n\n`MATCH` returns true if the provided query matches the row.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/median.json b/docs/reference/query-languages/esql/kibana/definition/functions/median.json index 5abb5d87aafd..3c8689ca0fc5 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/median.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/median.json @@ -2,8 +2,8 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "agg", "name" : "median", - "description" : "The value that is greater than half of all values and less than half of all values, also known as the 50% <>.", - "note" : "Like <>, `MEDIAN` is <>.", + "description" : "The value that is greater than half of all values and less than half of all values, also known as the 50% `PERCENTILE`.", + "note" : "Like `PERCENTILE`, `MEDIAN` is usually approximate.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json b/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json index 615a9b654345..edc42448084e 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/median_absolute_deviation.json @@ -3,7 +3,7 @@ "type" : "agg", "name" : "median_absolute_deviation", "description" : "Returns the median absolute deviation, a measure of variability. It is a robust statistic, meaning that it is useful for describing data that may have outliers, or may not be normally distributed. For such data it can be more descriptive than standard deviation.\n\nIt is calculated as the median of each data point’s deviation from the median of the entire sample. That is, for a random variable `X`, the median absolute deviation is `median(|median(X) - X|)`.", - "note" : "Like <>, `MEDIAN_ABSOLUTE_DEVIATION` is <>.", + "note" : "Like `PERCENTILE`, `MEDIAN_ABSOLUTE_DEVIATION` is usually approximate.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json b/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json index 08fbc425bfaa..6bd512388380 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/mv_first.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "mv_first", - "description" : "Converts a multivalued expression into a single valued column containing the\nfirst value. This is most useful when reading from a function that emits\nmultivalued columns in a known order like <>.", + "description" : "Converts a multivalued expression into a single valued column containing the\nfirst value. This is most useful when reading from a function that emits\nmultivalued columns in a known order like `SPLIT`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json b/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json index 1fd311ed113c..21d8d669dce7 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/mv_last.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "mv_last", - "description" : "Converts a multivalue expression into a single valued column containing the last\nvalue. This is most useful when reading from a function that emits multivalued\ncolumns in a known order like <>.", + "description" : "Converts a multivalue expression into a single valued column containing the last\nvalue. This is most useful when reading from a function that emits multivalued\ncolumns in a known order like `SPLIT`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json b/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json index 03ec525a9f84..149e309249bd 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/mv_slice.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "mv_slice", - "description" : "Returns a subset of the multivalued field using the start and end index values.\nThis is most useful when reading from a function that emits multivalued columns\nin a known order like <> or <>.", + "description" : "Returns a subset of the multivalued field using the start and end index values.\nThis is most useful when reading from a function that emits multivalued columns\nin a known order like `SPLIT` or `MV_SORT`.", "signatures" : [ { "params" : [ 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 4774d413d3c3..0c4f19d2dad0 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/qstr.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "qstr", - "description" : "Performs a <>. Returns true if the provided query string matches the row.", + "description" : "Performs a query string query. Returns true if the provided query string matches the row.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json index 18119288422a..a72e6a833c6e 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_contains.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_contains", - "description" : "Returns whether the first geometry contains the second geometry.\nThis is the inverse of the <> function.", + "description" : "Returns whether the first geometry contains the second geometry.\nThis is the inverse of the ST_WITHIN function.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json index adf6570b34c7..9e00ced00220 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_disjoint.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_disjoint", - "description" : "Returns whether the two geometries or geometry columns are disjoint.\nThis is the inverse of the <> function.\nIn mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅", + "description" : "Returns whether the two geometries or geometry columns are disjoint.\nThis is the inverse of the ST_INTERSECTS function.\nIn mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json index 7c868e1f3c47..6b7d5e844b42 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_intersects.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_intersects", - "description" : "Returns true if two geometries intersect.\nThey intersect if they have any point in common, including their interior points\n(points along lines or within polygons).\nThis is the inverse of the <> function.\nIn mathematical terms: ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅", + "description" : "Returns true if two geometries intersect.\nThey intersect if they have any point in common, including their interior points\n(points along lines or within polygons).\nThis is the inverse of the ST_DISJOINT function.\nIn mathematical terms: ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json index 8ad01022634c..94bf11529e04 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_within.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "st_within", - "description" : "Returns whether the first geometry is within the second geometry.\nThis is the inverse of the <> function.", + "description" : "Returns whether the first geometry is within the second geometry.\nThis is the inverse of the ST_CONTAINS function.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/tau.json b/docs/reference/query-languages/esql/kibana/definition/functions/tau.json index b70980a729b5..86c5cb75b1c1 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/tau.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/tau.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "tau", - "description" : "Returns the [ratio](https://tauday.com/tau-manifesto) of a circle’s circumference to its radius.", + "description" : "Returns the ratio of a circle’s circumference to its radius.", "signatures" : [ { "params" : [ ], diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json index 34db5304c9ca..86561d09a297 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianpoint.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_cartesianpoint", - "description" : "Converts an input value to a `cartesian_point` value.\nA string will only be successfully converted if it respects WKT Point format.", + "description" : "Converts an input value to a `cartesian_point` value.\nA string will only be successfully converted if it respects the\nWKT Point format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json index 5e7764b8b441..9c866cfd06c9 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_cartesianshape.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_cartesianshape", - "description" : "Converts an input value to a `cartesian_shape` value.\nA string will only be successfully converted if it respects WKT format.", + "description" : "Converts an input value to a `cartesian_shape` value.\nA string will only be successfully converted if it respects the\nWKT format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json index fe58cefb2bb3..3174709a9917 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_datetime.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_datetime", - "description" : "Converts an input value to a date value.\nA string will only be successfully converted if it’s respecting the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.\nTo convert dates in other formats, use <>.", + "description" : "Converts an input value to a date value.\nA string will only be successfully converted if it’s respecting the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.\nTo convert dates in other formats, use `DATE_PARSE`.", "note" : "Note that when converting from nanosecond resolution to millisecond resolution with this function, the nanosecond date is truncated, not rounded.", "signatures" : [ { diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json index 86d905b1d223..15f9a7757437 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_geopoint.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_geopoint", - "description" : "Converts an input value to a `geo_point` value.\nA string will only be successfully converted if it respects WKT Point format.", + "description" : "Converts an input value to a `geo_point` value.\nA string will only be successfully converted if it respects the\nWKT Point format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json b/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json index 4379222f8b30..bfc6f6c2d437 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/to_geoshape.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "scalar", "name" : "to_geoshape", - "description" : "Converts an input value to a `geo_shape` value.\nA string will only be successfully converted if it respects WKT format.", + "description" : "Converts an input value to a `geo_shape` value.\nA string will only be successfully converted if it respects the\nWKT format.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/values.json b/docs/reference/query-languages/esql/kibana/definition/functions/values.json index 5d2237522f2f..d64dc2143fe9 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/values.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/values.json @@ -2,7 +2,7 @@ "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", "type" : "agg", "name" : "values", - "description" : "Returns all values in a group as a multivalued field. The order of the returned values isn’t guaranteed. If you need the values returned in order use <>.", + "description" : "Returns all values in a group as a multivalued field. The order of the returned values isn’t guaranteed. If you need the values returned in order use `MV_SORT`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/add.json b/docs/reference/query-languages/esql/kibana/definition/operators/add.json index dbf28679d196..e96de8ec6b31 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/add.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/add.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "+", "name" : "add", - "description" : "Add two numbers together. If either field is <> then the result is `null`.", + "description" : "Add two numbers together. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/cast.json b/docs/reference/query-languages/esql/kibana/definition/operators/cast.json index 4983d8ba2f44..ee1459c2f53d 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/cast.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/cast.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "::", "name" : "cast", - "description" : "The `::` operator provides a convenient alternative syntax to the TO_ [conversion functions](https://www.elastic.co/docs/reference/elasticsearch/query-languages/esql/esql-functions-operators#esql-type-conversion-functions).", + "description" : "The `::` operator provides a convenient alternative syntax to the TO_ conversion functions.", "signatures" : [ ], "examples" : [ "ROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION" diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/div.json b/docs/reference/query-languages/esql/kibana/definition/operators/div.json index 93ddd93f973a..ce69b6b8408e 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/div.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/div.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "/", "name" : "div", - "description" : "Divide one number by another. If either field is <> then the result is `null`.", - "note" : "Division of two integer types will yield an integer result, rounding towards 0. If you need floating point division, <> one of the arguments to a `DOUBLE`.", + "description" : "Divide one number by another. If either field is multivalued then the result is `null`.", + "note" : "Division of two integer types will yield an integer result, rounding towards 0. If you need floating point division, `Cast (::)` one of the arguments to a `DOUBLE`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/equals.json b/docs/reference/query-languages/esql/kibana/definition/operators/equals.json index 33735e3379eb..a77e8574f72d 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/equals.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/equals.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "==", "name" : "equals", - "description" : "Check if two fields are equal. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if two fields are equal. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json index 3fa7c689a96f..74e60ba4f73d 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : ">", "name" : "greater_than", - "description" : "Check if one field is greater than another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is greater than another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json index 1de820d71480..6a2cf137e04c 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/greater_than_or_equal.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : ">=", "name" : "greater_than_or_equal", - "description" : "Check if one field is greater than or equal to another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is greater than or equal to another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json b/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json new file mode 100644 index 000000000000..9573c5c92240 --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_not_null.json @@ -0,0 +1,194 @@ +{ + "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", + "type" : "operator", + "operator" : "predicates", + "name" : "is_not_null", + "description" : "Use `IS NOT NULL` to filter data based on whether the field exists or not.", + "signatures" : [ + { + "params" : [ + { + "name" : "field", + "type" : "boolean", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date_nanos", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "double", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "integer", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "ip", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "keyword", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "text", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "unsigned_long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "version", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + } + ], + "examples" : [ + "FROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS COUNT(emp_no)" + ], + "preview" : false, + "snapshot_only" : false +} 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 new file mode 100644 index 000000000000..0241fc9b1f79 --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/definition/operators/is_null.json @@ -0,0 +1,194 @@ +{ + "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.", + "type" : "operator", + "operator" : "predicates", + "name" : "is_null", + "description" : "Use `IS NULL` to filter data based on whether the field exists or not.", + "signatures" : [ + { + "params" : [ + { + "name" : "field", + "type" : "boolean", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "cartesian_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "date_nanos", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "double", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_point", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "geo_shape", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "integer", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "ip", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "keyword", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "text", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "unsigned_long", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "version", + "optional" : false, + "description" : "Input value. The input can be a single- or multi-valued column or an expression." + } + ], + "variadic" : false, + "returnType" : "boolean" + } + ], + "examples" : [ + "FROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3" + ], + "preview" : false, + "snapshot_only" : false +} diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json b/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json index eaefe5a16ebb..43d7ffc233d7 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/less_than.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "<", "name" : "less_than", - "description" : "Check if one field is less than another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is less than another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json b/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json index da354e5e2efd..2070612e47c7 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/less_than_or_equal.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "<=", "name" : "less_than_or_equal", - "description" : "Check if one field is less than or equal to another. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if one field is less than or equal to another. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ 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 9c47c56d0a7a..37ec36d46f90 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 @@ -3,7 +3,7 @@ "type" : "operator", "operator" : ":", "name" : "match_operator", - "description" : "Use the match operator (`:`) to perform a <> on the specified field.\nUsing `:` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nThe match operator is equivalent to the <>.\n\nFor using the function syntax, or adding <>, you can use the\n<>.\n\n`:` returns true if the provided query matches the row.", + "description" : "Use the match operator (`:`) to perform a match query on the specified field.\nUsing `:` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nThe match operator is equivalent to the match function.\n\nFor using the function syntax, or adding match query parameters, you can use the\nmatch function.\n\n`:` returns true if the provided query matches the row.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/mod.json b/docs/reference/query-languages/esql/kibana/definition/operators/mod.json index 69ecc4e40388..eeda5e37f5f4 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/mod.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/mod.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "%", "name" : "mod", - "description" : "Divide one number by another and return the remainder. If either field is <> then the result is `null`.", + "description" : "Divide one number by another and return the remainder. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/mul.json b/docs/reference/query-languages/esql/kibana/definition/operators/mul.json index 163623e03e96..feb441b9213b 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/mul.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/mul.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "*", "name" : "mul", - "description" : "Multiply two numbers together. If either field is <> then the result is `null`.", + "description" : "Multiply two numbers together. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json b/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json index 8ef2462be874..9015754cb4d5 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/not rlike.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "not rlike", "name" : "not_rlike", - "description" : "Use `RLIKE` to filter data based on string patterns using using\n<>. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", + "description" : "Use `RLIKE` to filter data based on string patterns using using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json b/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json index c4dddf0268c6..de839329765b 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/not_equals.json @@ -3,8 +3,8 @@ "type" : "operator", "operator" : "!=", "name" : "not_equals", - "description" : "Check if two fields are unequal. If either field is <> then the result is `null`.", - "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an <> and <>.", + "description" : "Check if two fields are unequal. If either field is multivalued then the result is `null`.", + "note" : "This is pushed to the underlying search index if one side of the comparison is constant and the other side is a field in the index that has both an mapping-index and doc-values.", "signatures" : [ { "params" : [ 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 247e356593b3..6c909368787e 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/predicates.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "predicates", "name" : "predicates", - "description" : "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates:", + "description" : "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json b/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json index 5d1ddf2cafa2..e1cdddf06bd8 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/rlike.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "RLIKE", "name" : "rlike", - "description" : "Use `RLIKE` to filter data based on string patterns using using\n<>. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", + "description" : "Use `RLIKE` to filter data based on string patterns using using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/definition/operators/sub.json b/docs/reference/query-languages/esql/kibana/definition/operators/sub.json index 63db4a47dadb..a476a0ae1886 100644 --- a/docs/reference/query-languages/esql/kibana/definition/operators/sub.json +++ b/docs/reference/query-languages/esql/kibana/definition/operators/sub.json @@ -3,7 +3,7 @@ "type" : "operator", "operator" : "-", "name" : "sub", - "description" : "Subtract one number from another. If either field is <> then the result is `null`.", + "description" : "Subtract one number from another. If either field is multivalued then the result is `null`.", "signatures" : [ { "params" : [ diff --git a/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md b/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md new file mode 100644 index 000000000000..0cd8c059dd4e --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_not_null.md @@ -0,0 +1,12 @@ + + +### IS_NOT_NULL +Use `IS NOT NULL` to filter data based on whether the field exists or not. + +```esql +FROM employees +| WHERE is_rehired IS NOT NULL +| STATS COUNT(emp_no) +``` 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 new file mode 100644 index 000000000000..d6258ea91881 --- /dev/null +++ b/docs/reference/query-languages/esql/kibana/docs/operators/is_null.md @@ -0,0 +1,14 @@ + + +### IS_NULL +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/predicates.md b/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md index bd959656d981..00d3790cd79d 100644 --- a/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md +++ b/docs/reference/query-languages/esql/kibana/docs/operators/predicates.md @@ -3,7 +3,7 @@ This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../RE --> ### PREDICATES -For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates: +For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates. ```esql FROM employees diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java index 0d20d90a95c8..fd45abc23e12 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/DocsV3Support.java @@ -1037,7 +1037,10 @@ public abstract class DocsV3Support { } private String removeAsciidocLinks(String asciidoc) { - return asciidoc.replaceAll("[^ ]+\\[([^]]+)]", "$1"); + // Some docs have asciidoc links while others use the newer markdown, so we need to first replace asciidoc with markdown + String md = replaceLinks(asciidoc); + // Now replace the markdown with just the display text + return md.replaceAll("\\[(\\s*`?[^]]+?`?\\s*)]\\(([^()\\s]+(?:\\([^()]*\\)[^()]*)*)\\)", "$1"); } private List, DataType>> sortedSignatures() { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java index 674a7fe77f58..24c27db35a8b 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/NullPredicatesTests.java @@ -36,14 +36,31 @@ public class NullPredicatesTests extends ESTestCase { if (System.getProperty("generateDocs") == null) { return; } - DocsV3Support.OperatorConfig op = new DocsV3Support.OperatorConfig( - "predicates", - "IS NULL and IS NOT NULL", - TestCastOperator.class, - DocsV3Support.OperatorCategory.UNARY, - false + renderNullPredicate( + new DocsV3Support.OperatorConfig( + "predicates", + "IS NULL and IS NOT NULL", + TestNullPredicates.class, + DocsV3Support.OperatorCategory.UNARY, + false + ) ); - var docs = new DocsV3Support.OperatorsDocsSupport("predicates", NullPredicatesTests.class, op, NullPredicatesTests::signatures); + renderNullPredicate( + new DocsV3Support.OperatorConfig("is_null", "IS NULL", TestIsNullPredicate.class, DocsV3Support.OperatorCategory.UNARY, false) + ); + renderNullPredicate( + new DocsV3Support.OperatorConfig( + "is_not_null", + "IS NOT NULL", + TestIsNotNullPredicate.class, + DocsV3Support.OperatorCategory.UNARY, + false + ) + ); + } + + private static void renderNullPredicate(DocsV3Support.OperatorConfig op) throws IOException { + var docs = new DocsV3Support.OperatorsDocsSupport(op.name(), NullPredicatesTests.class, op, NullPredicatesTests::signatures); docs.renderSignature(); docs.renderDocs(); } @@ -62,14 +79,82 @@ public class NullPredicatesTests extends ESTestCase { /** * This class only exists to provide FunctionInfo for the documentation */ - public class TestCastOperator { + public class TestNullPredicates { @FunctionInfo( operator = "predicates", returnType = {}, - description = "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates:", + description = "For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates.", examples = { @Example(file = "null", tag = "is-null"), @Example(file = "null", tag = "is-not-null") } ) - public TestCastOperator( + public TestNullPredicates( + @Param( + name = "field", + type = { + "boolean", + "cartesian_point", + "cartesian_shape", + "date", + "date_nanos", + "double", + "geo_point", + "geo_shape", + "integer", + "ip", + "keyword", + "long", + "text", + "unsigned_long", + "version" }, + description = "Input value. The input can be a single- or multi-valued column or an expression." + ) Expression v + ) {} + } + + /** + * This class only exists to provide FunctionInfo for the documentation + */ + public class TestIsNullPredicate { + @FunctionInfo( + operator = "predicates", + returnType = {}, + description = "Use `IS NULL` to filter data based on whether the field exists or not.", + examples = { @Example(file = "null", tag = "is-null") } + ) + public TestIsNullPredicate( + @Param( + name = "field", + type = { + "boolean", + "cartesian_point", + "cartesian_shape", + "date", + "date_nanos", + "double", + "geo_point", + "geo_shape", + "integer", + "ip", + "keyword", + "long", + "text", + "unsigned_long", + "version" }, + description = "Input value. The input can be a single- or multi-valued column or an expression." + ) Expression v + ) {} + } + + /** + * This class only exists to provide FunctionInfo for the documentation + */ + public class TestIsNotNullPredicate { + @FunctionInfo( + operator = "predicates", + returnType = {}, + description = "Use `IS NOT NULL` to filter data based on whether the field exists or not.", + examples = { @Example(file = "null", tag = "is-not-null") } + ) + public TestIsNotNullPredicate( @Param( name = "field", type = {