Understanding how ES|QL works
The query language works fundamentally through a source command, and it can be followed by (optional) commands called processing commands. They are separated by a pipe (|); hence, ES|QL is also referred to as Elastic’s piped query language. The source command results into a table formation from the data in Elasticsearch, as shown in the following figure:
Figure 9.1 – The source command concept in Elasticsearch
Three different source commands that are supported, which are FROM
, ROW
, and SHOW
.
Here’s a simple example of how ES|QL works. Imagine you have an index named products
that contains product data, and you want to find all products with a price above $50.
With ES|QL, you could write the following query:
FROM products WHERE price > 50;
This query looks just like a standard SQL query, but ES|QL translates it into Elasticsearch’s query language, retrieving the desired results. Refer...