IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

Adding processing commands

edit

Once you have a query object, you can add one or more processing commands to it. The following example shows how to create a query that uses the WHERE and LIMIT commands to filter the results:

from elasticsearch.esql import ESQL

# FROM employees
# | WHERE still_hired == true
# | LIMIT 10
query = ESQL.from_("employees").where("still_hired == true").limit(10)

For a complete list of available commands, review the methods of the ESQLBase class in the Elasticsearch Python API documentation.