index.asciidoc 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. [[esql]]
  2. = {esql}
  3. :esql-tests: {xes-repo-dir}/../../plugin/esql/qa
  4. :esql-specs: {esql-tests}/testFixtures/src/main/resources
  5. [partintro]
  6. preview::[]
  7. The {es} Query Language ({esql}) provides a powerful way to filter, transform, and analyze data stored in {es}.
  8. Users can author {esql} queries to find specific events, perform statistical analysis, and generate visualizations.
  9. It supports a wide range of commands and functions that enable users to perform various data operations,
  10. such as filtering, aggregation, time-series analysis, and more.
  11. The {es} Query Language ({esql}) makes use of "pipes" to manipulate and transform data in a step-by-step fashion.
  12. This approach allows users to compose a series of operations, where the output of one operation becomes the input for the next,
  13. enabling complex data transformations and analysis.
  14. A simple example of an {esql} query is shown below:
  15. [source,esql]
  16. ----
  17. FROM employees
  18. | EVAL age = DATE_DIFF(NOW(), birth_date, 'Y')
  19. | STATS AVG(age) BY department
  20. | SORT age DESC
  21. ----
  22. Each {esql} query starts with a <<esql-commands,source command>>. A source command produces
  23. a table, typically with data from {es}.
  24. image::images/esql/source-command.svg[A source command producing a table from {es},align="center"]
  25. A source command can be followed by one or more
  26. <<esql-commands,processing commands>>. Processing commands change an
  27. input table by adding, removing, or changing rows and columns.
  28. Processing commands can perform filtering, projection, aggregation, and more.
  29. image::images/esql/processing-command.svg[A processing command changing an input table,align="center"]
  30. You can chain processing commands, separated by a pipe character: `|`. Each
  31. processing command works on the output table of the previous command.
  32. image::images/esql/chaining-processing-commands.svg[Processing commands can be chained,align="center"]
  33. The result of a query is the table produced by the final processing command.
  34. [discrete]
  35. === The {esql} Compute Engine
  36. {esql} is more than a language. It represents a significant investment in new compute capabilities within {es}.
  37. To achieve both the functional and performance requirements for {esql}, it was necessary to build an entirely new
  38. compute architecture. {esql} search, aggregation, and transformation functions are directly executed within Elasticsearch
  39. itself. Query expressions are not transpiled to Query DSL for execution. This approach allows {esql} to be extremely performant and versatile.
  40. The new {esql} execution engine was designed with performance in mind — it operates on blocks at a time instead of per row, targets vectorization and cache locality, and embraces specialization and multi-threading. It is a separate component from the existing Elasticsearch aggregation framework with different performance characteristics.
  41. include::esql-get-started.asciidoc[]
  42. include::esql-language.asciidoc[]
  43. include::esql-rest.asciidoc[]
  44. include::esql-kibana.asciidoc[]
  45. include::task-management.asciidoc[]
  46. include::esql-limitations.asciidoc[]
  47. :esql-tests!:
  48. :esql-specs!: