esql-limitations.asciidoc 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. [discrete]
  85. [[esql-limitations-full-text-search]]
  86. === Full-text search
  87. One limitation of <<esql-search-functions,full-text search>> is that
  88. it is necessary to use the search function, like <<esql-match>>, in a <<esql-where>> command
  89. directly after the <<esql-from>> source command, or close enough to it.
  90. Otherwise, the query will fail with a validation error.
  91. Another limitation is that any <<esql-where>> command containing a full-text search function
  92. cannot use disjunctions (`OR`), unless:
  93. * All functions used in the OR clauses are full-text functions themselves, or scoring is not used
  94. For example, this query is valid:
  95. [source,esql]
  96. ----
  97. FROM books
  98. | WHERE MATCH(author, "Faulkner") AND MATCH(author, "Tolkien")
  99. ----
  100. But this query will fail due to the <<esql-stats-by, STATS>> command:
  101. [source,esql]
  102. ----
  103. FROM books
  104. | STATS AVG(price) BY author
  105. | WHERE MATCH(author, "Faulkner")
  106. ----
  107. And this query that uses a disjunction will succeed:
  108. [source,esql]
  109. ----
  110. FROM books
  111. | WHERE MATCH(author, "Faulkner") OR QSTR("author: Hemingway")
  112. ----
  113. However using scoring will fail because it uses a non full text function as part of the disjunction:
  114. [source,esql]
  115. ----
  116. FROM books METADATA _score
  117. | WHERE MATCH(author, "Faulkner") OR author LIKE "Hemingway"
  118. ----
  119. Scoring will work in the following query, as it uses full text functions on both `OR` clauses:
  120. [source,esql]
  121. ----
  122. FROM books METADATA _score
  123. | WHERE MATCH(author, "Faulkner") OR QSTR("author: Hemingway")
  124. ----
  125. Note that, because of <<esql-limitations-text-fields,the way {esql} treats `text` values>>,
  126. any queries on `text` fields that do not explicitly use the full-text functions,
  127. <<esql-match>>, <<esql-qstr>> or <<esql-kql>>, will behave as if the fields are actually `keyword` fields:
  128. they are case-sensitive and need to match the full string.
  129. [discrete]
  130. [[esql-limitations-text-fields]]
  131. === `text` fields behave like `keyword` fields
  132. While {esql} supports <<text,`text`>> fields, {esql} does not treat these fields
  133. like the Search API does. {esql} queries do not query or aggregate the
  134. <<analysis,analyzed string>>. Instead, an {esql} query will try to get a `text`
  135. field's subfield of the <<keyword,keyword family type>> and query/aggregate
  136. that. If it's not possible to retrieve a `keyword` subfield, {esql} will get the
  137. string from a document's `_source`. If the `_source` cannot be retrieved, for
  138. example when using synthetic source, `null` is returned.
  139. Once a `text` field is retrieved, if the query touches it in any way, for example passing
  140. it into a function, the type will be converted to `keyword`. In fact, functions that operate on both
  141. `text` and `keyword` fields will perform as if the `text` field was a `keyword` field all along.
  142. For example, the following query will return a column `greatest` of type `keyword` no matter
  143. whether any or all of `field1`, `field2`, and `field3` are of type `text`:
  144. [source,esql]
  145. ----
  146. | FROM index
  147. | EVAL greatest = GREATEST(field1, field2, field3)
  148. ----
  149. Note that {esql}'s retrieval of `keyword` subfields may have unexpected
  150. consequences. Other than when explicitly using the full-text functions, <<esql-match>> and <<esql-qstr>>,
  151. any {esql} query on a `text` field is case-sensitive.
  152. For example, after indexing a field of type `text` with the value `Elasticsearch
  153. query language`, the following `WHERE` clause does not match because the `LIKE`
  154. operator is case-sensitive:
  155. [source,esql]
  156. ----
  157. | WHERE field LIKE "elasticsearch query language"
  158. ----
  159. The following `WHERE` clause does not match either, because the `LIKE` operator
  160. tries to match the whole string:
  161. [source,esql]
  162. ----
  163. | WHERE field LIKE "Elasticsearch"
  164. ----
  165. As a workaround, use wildcards and regular expressions. For example:
  166. [source,esql]
  167. ----
  168. | WHERE field RLIKE "[Ee]lasticsearch.*"
  169. ----
  170. Furthermore, a subfield may have been mapped with a <<normalizer,normalizer>>, which can
  171. transform the original string. Or it may have been mapped with <<ignore-above>>,
  172. which can truncate the string. None of these mapping operations are applied to
  173. an {esql} query, which may lead to false positives or negatives.
  174. To avoid these issues, a best practice is to be explicit about the field that
  175. you query, and query `keyword` sub-fields instead of `text` fields.
  176. Or consider using one of the <<esql-search-functions,full-text search>> functions.
  177. [discrete]
  178. [[esql-multi-index-limitations]]
  179. === Using {esql} to query multiple indices
  180. As discussed in more detail in <<esql-multi-index>>, {esql} can execute a single query across multiple indices,
  181. data streams, or aliases. However, there are some limitations to be aware of:
  182. * All underlying indexes and shards must be active. Using admin commands or UI,
  183. it is possible to pause an index or shard, for example by disabling a frozen tier instance,
  184. but then any {esql} query that includes that index or shard will fail, even if the query uses
  185. <<esql-where>> to filter out the results from the paused index.
  186. If you see an error of type `search_phase_execution_exception`,
  187. with the message `Search rejected due to missing shards`, you likely have an index or shard in `UNASSIGNED` state.
  188. * The same field must have the same type across all indexes. If the same field is mapped to different types
  189. it is still possible to query the indexes,
  190. but the field must be <<esql-multi-index-union-types,explicitly converted to a single type>>.
  191. [discrete]
  192. [[esql-tsdb]]
  193. === Time series data streams are not supported
  194. {esql} does not support querying time series data streams (TSDS).
  195. [discrete]
  196. [[esql-limitations-date-math]]
  197. === Date math limitations
  198. Date math expressions work well when the leftmost expression is a datetime, for
  199. example:
  200. [source,txt]
  201. ----
  202. now() + 1 year - 2hour + ...
  203. ----
  204. But using parentheses or putting the datetime to the right is not always supported yet. For example, the following expressions fail:
  205. [source,txt]
  206. ----
  207. 1year + 2hour + now()
  208. now() + (1year + 2hour)
  209. ----
  210. Date math does not allow subtracting two datetimes, for example:
  211. [source,txt]
  212. ----
  213. now() - 2023-10-26
  214. ----
  215. [discrete]
  216. [[esql-limitations-enrich]]
  217. === Enrich limitations
  218. include::esql-enrich-data.asciidoc[tag=limitations]
  219. [discrete]
  220. [[esql-limitations-dissect]]
  221. === Dissect limitations
  222. include::esql-process-data-with-dissect-grok.asciidoc[tag=dissect-limitations]
  223. [discrete]
  224. [[esql-limitations-grok]]
  225. === Grok limitations
  226. include::esql-process-data-with-dissect-grok.asciidoc[tag=grok-limitations]
  227. [discrete]
  228. [[esql-limitations-mv]]
  229. === Multivalue limitations
  230. {esql} <<esql-multivalued-fields,supports multivalued fields>>, but functions
  231. return `null` when applied to a multivalued field, unless documented otherwise.
  232. Work around this limitation by converting the field to single value with one of
  233. the <<esql-mv-functions,multivalue functions>>.
  234. [discrete]
  235. [[esql-limitations-timezone]]
  236. === Timezone support
  237. {esql} only supports the UTC timezone.
  238. [discrete]
  239. [[esql-limitations-kibana]]
  240. === Kibana limitations
  241. include::esql-kibana.asciidoc[tag=limitations]