What is Elasticsearch?
A distributed search and analytics engine designed for fast querying over large datasets and stores data as JSON documents. Elasticsearch is also part of the ELK stack (Elasticsearch, Logstash, Kibana), widely used for logs, observability, and analytics.
Elasticsearch is commonly used in:
It supports:
What is an index in Elasticsearch?
A collection of JSON documents grouped under a name, similar to a database table.
What is a document in Elasticsearch?
A JSON object stored inside an index; equivalent to a row in SQL.
What is a schema (mapping) in Elasticsearch?
A definition of fields and their data types for an index.
What type of queries does Elasticsearch support?
Full-text queries for text fields and exact-match queries for keyword fields.
What is a full-text query in Elasticsearch?
A query that analyzes text and searches indexed documents for relevant, tokenized matches within a field.
What is an exact-match query in Elasticsearch?
A query that searches for exact terms in fields of type keyword.
How do you index a document in Elasticsearch?
Using POST /<index>/_doc with a JSON body containing the document.</index>
How do you update a document in Elasticsearch?
Using POST /<index>/_update/<id> with partial fields to modify.
How do you search documents in Elasticsearch?
Using POST ` /<index>/_search` with a query body defining match or term queries.</index>