Build your search queries
Elastic Stack Serverless
This page is focused on the search use case. For an overview of Elastic query languages for every use case, refer to the complete overview.
Once you know which search approaches you need to use, you can start building and testing your search queries. Elasticsearch provides several query languages to help you express your search logic.
Interface | Endpoint | Description | Best for |
---|---|---|---|
Query DSL | _search |
Original, JSON-based query language native to Elasticsearch. Powerful but complex syntax. | Full-text and semantic search queries |
ESQL | _query |
Fast, SQL-like language with piped syntax, built on new compute architecture. | Filtering, analysis, aggregations |
Retrievers | _search |
Modern _search API syntax focused on composability. |
Building complex search pipelines, especially those using semantic search. Required for semantic reranking. |
These query languages are complementary, not mutually exclusive. You can use different query languages for different parts of your application, based on your specific needs. This flexibility allows you to gradually adopt newer interfaces as your requirements evolve.
You can use the Elasticsearch REST APIs to search your data using any HTTP client, including the Elasticsearch client libraries, or directly in Console. You can also run searches using Discover in the UI.
Try our hands-on quick start tutorials to get started, or check out our Python notebooks.