esql-limitations.asciidoc 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. [[esql-limitations]]
  2. == {esql} limitations
  3. ++++
  4. <titleabbrev>Limitations</titleabbrev>
  5. ++++
  6. [discrete]
  7. [[esql-max-rows]]
  8. === Result set size limit
  9. By default, an {esql} query returns up to 1,000 rows. You can increase the number
  10. of rows up to 10,000 using the <<esql-limit>> command.
  11. include::processing-commands/limit.asciidoc[tag=limitation]
  12. [discrete]
  13. [[esql-supported-types]]
  14. === Field types
  15. [discrete]
  16. ==== Supported types
  17. {esql} currently supports the following <<mapping-types,field types>>:
  18. * `alias`
  19. * `boolean`
  20. * `date`
  21. * `date_nanos` (Tech Preview)
  22. ** The following functions don't yet support date nanos: `bucket`, `date_format`, `date_parse`, `date_diff`, `date_extract`
  23. ** You can use `to_datetime` to cast to millisecond dates to use unsupported functions
  24. * `double` (`float`, `half_float`, `scaled_float` are represented as `double`)
  25. * `ip`
  26. * `keyword` <<keyword, family>> including `keyword`, `constant_keyword`, and `wildcard`
  27. * `int` (`short` and `byte` are represented as `int`)
  28. * `long`
  29. * `null`
  30. * `text` <<text, family>> including `text`, `semantic_text` and `match_only_text`
  31. * experimental:[] `unsigned_long`
  32. * `version`
  33. * Spatial types
  34. ** `geo_point`
  35. ** `geo_shape`
  36. ** `point`
  37. ** `shape`
  38. [discrete]
  39. ==== Unsupported types
  40. {esql} does not yet support the following field types:
  41. * TSDB metrics
  42. ** `counter`
  43. ** `position`
  44. ** `aggregate_metric_double`
  45. * Date/time
  46. ** `date_range`
  47. * Other types
  48. ** `binary`
  49. ** `completion`
  50. ** `dense_vector`
  51. ** `double_range`
  52. ** `flattened`
  53. ** `float_range`
  54. ** `histogram`
  55. ** `integer_range`
  56. ** `ip_range`
  57. ** `long_range`
  58. ** `nested`
  59. ** `rank_feature`
  60. ** `rank_features`
  61. ** `search_as_you_type`
  62. Querying a column with an unsupported type returns an error. If a column with an
  63. unsupported type is not explicitly used in a query, it is returned with `null`
  64. values, with the exception of nested fields. Nested fields are not returned at
  65. all.
  66. [discrete]
  67. ==== Limitations on supported types
  68. Some <<mapping-types,field types>> are not supported in all contexts:
  69. * Spatial types are not supported in the <<esql-sort,SORT>> processing command.
  70. Specifying a column of one of these types as a sort parameter will result in an error:
  71. ** `geo_point`
  72. ** `geo_shape`
  73. ** `cartesian_point`
  74. ** `cartesian_shape`
  75. In addition, when <<esql-multi-index, querying multiple indexes>>,
  76. it's possible for the same field to be mapped to multiple types.
  77. These fields cannot be directly used in queries or returned in results,
  78. unless they're <<esql-multi-index-union-types, explicitly converted to a single type>>.
  79. [discrete]
  80. [[esql-_source-availability]]
  81. === _source availability
  82. {esql} does not support configurations where the
  83. <<mapping-source-field,_source field>> is <<disable-source-field,disabled>>.
  84. experimental:[] {esql}'s support for <<synthetic-source,synthetic `_source`>>
  85. is currently experimental.
  86. [discrete]
  87. [[esql-limitations-full-text-search]]
  88. === Full-text search
  89. experimental:[] {esql}'s support for <<esql-search-functions,full-text search>>
  90. is currently in Technical Preview. One limitation of full-text search is that
  91. it is necessary to use the search function, like <<esql-match>>, in a <<esql-where>> command
  92. directly after the <<esql-from>> source command, or close enough to it.
  93. Otherwise, the query will fail with a validation error.
  94. Another limitation is that any <<esql-where>> command containing a full-text search function
  95. cannot use disjunctions (`OR`), unless:
  96. * All functions used in the OR clauses are full-text functions themselves, or scoring is not used
  97. For example, this query is valid:
  98. [source,esql]
  99. ----
  100. FROM books
  101. | WHERE MATCH(author, "Faulkner") AND MATCH(author, "Tolkien")
  102. ----
  103. But this query will fail due to the <<esql-stats-by, STATS>> command:
  104. [source,esql]
  105. ----
  106. FROM books
  107. | STATS AVG(price) BY author
  108. | WHERE MATCH(author, "Faulkner")
  109. ----
  110. And this query that uses a disjunction will succeed:
  111. [source,esql]
  112. ----
  113. FROM books
  114. | WHERE MATCH(author, "Faulkner") OR QSTR("author: Hemingway")
  115. ----
  116. However using scoring will fail because it uses a non full text function as part of the disjunction:
  117. [source,esql]
  118. ----
  119. FROM books METADATA _score
  120. | WHERE MATCH(author, "Faulkner") OR author LIKE "Hemingway"
  121. ----
  122. Scoring will work in the following query, as it uses full text functions on both `OR` clauses:
  123. [source,esql]
  124. ----
  125. FROM books METADATA _score
  126. | WHERE MATCH(author, "Faulkner") OR QSTR("author: Hemingway")
  127. ----
  128. Note that, because of <<esql-limitations-text-fields,the way {esql} treats `text` values>>,
  129. any queries on `text` fields that do not explicitly use the full-text functions,
  130. <<esql-match>>, <<esql-qstr>> or <<esql-kql>>, will behave as if the fields are actually `keyword` fields:
  131. they are case-sensitive and need to match the full string.
  132. [discrete]
  133. [[esql-limitations-text-fields]]
  134. === `text` fields behave like `keyword` fields
  135. While {esql} supports <<text,`text`>> fields, {esql} does not treat these fields
  136. like the Search API does. {esql} queries do not query or aggregate the
  137. <<analysis,analyzed string>>. Instead, an {esql} query will try to get a `text`
  138. field's subfield of the <<keyword,keyword family type>> and query/aggregate
  139. that. If it's not possible to retrieve a `keyword` subfield, {esql} will get the
  140. string from a document's `_source`. If the `_source` cannot be retrieved, for
  141. example when using synthetic source, `null` is returned.
  142. Once a `text` field is retrieved, if the query touches it in any way, for example passing
  143. it into a function, the type will be converted to `keyword`. In fact, functions that operate on both
  144. `text` and `keyword` fields will perform as if the `text` field was a `keyword` field all along.
  145. For example, the following query will return a column `greatest` of type `keyword` no matter
  146. whether any or all of `field1`, `field2`, and `field3` are of type `text`:
  147. [source,esql]
  148. ----
  149. | FROM index
  150. | EVAL greatest = GREATEST(field1, field2, field3)
  151. ----
  152. Note that {esql}'s retrieval of `keyword` subfields may have unexpected
  153. consequences. Other than when explicitly using the full-text functions, <<esql-match>> and <<esql-qstr>>,
  154. any {esql} query on a `text` field is case-sensitive.
  155. For example, after indexing a field of type `text` with the value `Elasticsearch
  156. query language`, the following `WHERE` clause does not match because the `LIKE`
  157. operator is case-sensitive:
  158. [source,esql]
  159. ----
  160. | WHERE field LIKE "elasticsearch query language"
  161. ----
  162. The following `WHERE` clause does not match either, because the `LIKE` operator
  163. tries to match the whole string:
  164. [source,esql]
  165. ----
  166. | WHERE field LIKE "Elasticsearch"
  167. ----
  168. As a workaround, use wildcards and regular expressions. For example:
  169. [source,esql]
  170. ----
  171. | WHERE field RLIKE "[Ee]lasticsearch.*"
  172. ----
  173. Furthermore, a subfield may have been mapped with a <<normalizer,normalizer>>, which can
  174. transform the original string. Or it may have been mapped with <<ignore-above>>,
  175. which can truncate the string. None of these mapping operations are applied to
  176. an {esql} query, which may lead to false positives or negatives.
  177. To avoid these issues, a best practice is to be explicit about the field that
  178. you query, and query `keyword` sub-fields instead of `text` fields.
  179. Or consider using one of the <<esql-search-functions,full-text search>> functions.
  180. [discrete]
  181. [[esql-multi-index-limitations]]
  182. === Using {esql} to query multiple indices
  183. As discussed in more detail in <<esql-multi-index>>, {esql} can execute a single query across multiple indices,
  184. data streams, or aliases. However, there are some limitations to be aware of:
  185. * All underlying indexes and shards must be active. Using admin commands or UI,
  186. it is possible to pause an index or shard, for example by disabling a frozen tier instance,
  187. but then any {esql} query that includes that index or shard will fail, even if the query uses
  188. <<esql-where>> to filter out the results from the paused index.
  189. If you see an error of type `search_phase_execution_exception`,
  190. with the message `Search rejected due to missing shards`, you likely have an index or shard in `UNASSIGNED` state.
  191. * The same field must have the same type across all indexes. If the same field is mapped to different types
  192. it is still possible to query the indexes,
  193. but the field must be <<esql-multi-index-union-types,explicitly converted to a single type>>.
  194. [discrete]
  195. [[esql-tsdb]]
  196. === Time series data streams are not supported
  197. {esql} does not support querying time series data streams (TSDS).
  198. [discrete]
  199. [[esql-limitations-date-math]]
  200. === Date math limitations
  201. Date math expressions work well when the leftmost expression is a datetime, for
  202. example:
  203. [source,txt]
  204. ----
  205. now() + 1 year - 2hour + ...
  206. ----
  207. But using parentheses or putting the datetime to the right is not always supported yet. For example, the following expressions fail:
  208. [source,txt]
  209. ----
  210. 1year + 2hour + now()
  211. now() + (1year + 2hour)
  212. ----
  213. Date math does not allow subtracting two datetimes, for example:
  214. [source,txt]
  215. ----
  216. now() - 2023-10-26
  217. ----
  218. [discrete]
  219. [[esql-limitations-enrich]]
  220. === Enrich limitations
  221. include::esql-enrich-data.asciidoc[tag=limitations]
  222. [discrete]
  223. [[esql-limitations-dissect]]
  224. === Dissect limitations
  225. include::esql-process-data-with-dissect-grok.asciidoc[tag=dissect-limitations]
  226. [discrete]
  227. [[esql-limitations-grok]]
  228. === Grok limitations
  229. include::esql-process-data-with-dissect-grok.asciidoc[tag=grok-limitations]
  230. [discrete]
  231. [[esql-limitations-mv]]
  232. === Multivalue limitations
  233. {esql} <<esql-multivalued-fields,supports multivalued fields>>, but functions
  234. return `null` when applied to a multivalued field, unless documented otherwise.
  235. Work around this limitation by converting the field to single value with one of
  236. the <<esql-mv-functions,multivalue functions>>.
  237. [discrete]
  238. [[esql-limitations-timezone]]
  239. === Timezone support
  240. {esql} only supports the UTC timezone.
  241. [discrete]
  242. [[esql-limitations-kibana]]
  243. === Kibana limitations
  244. include::esql-kibana.asciidoc[tag=limitations]