Welcome to the Beginner's Crash Course to Elastic Stack!
This repo contains all resources shared during workshop Part 1: Intro to Elasticsearch and Kibana.
By the end of this workshop, you will be able to:
- understand a use case of Elasticsearch and Kibana
- understand the basic architecture of Elasticsearch
- perform CRUD(Create, Read, Update, and Delete) operations with Elasticsearch and Kibana
Beginner's Crash Course to Elastic Stack Table of Contents
This workshop is a part of the Beginner's Crash Course to Elastic Stack series. Check out this table contents to access all the workshops in the series thus far. This table will continue to get updated as more workshops in the series are released!
Instructions on how to access Elasticsearch and Kibana on Elastic Cloud
Instructions for downloading Elasticsearch and Kibana
Alternative installation using Docker
One of our AMAZING community member @h3ct0rjs has shared how you can run Elasticsearch and Kibana using Docker! Refer to this link for his awesome step by step directions. Thank you so much @h3ct0rjs!!
Video recording of the workshop
Mini Beginner's Crash Course to Elasticsearch & Kibana playlist
Do you prefer learning by watching shorter videos? Check out this playlist to watch short clips of beginner's crash course full length workshops. Part 1 workshop is broken down into episodes 1-6. Season 2 clips will be uploaded here in the future!
Blog Beginner's guide to Elasticsearch
Blog Beginner's guide to performing CRUD operations with Elasticsearch and Kibana
Elastic America Virtual Chapter Want to attend live workshops? Join the Elastic America Virtual Chapter to get the deets!
What's next? Eager to continue your learning after mastering the concept from this workshop? Move on to Part 2: Understanding the relevance of your search with Elasticsearch and Kibana here!
Syntax:
GET _API/parameter
GET _cluster/health
Expected response from Elasticsearch:
GET _nodes/stats
Expected response from Elasticsearch:
Syntax:
PUT Name-of-the-Index
Example:
PUT favorite_candy
Expected response from Elasticsearch:
When indexing a document, both HTTP verbs POST
or PUT
can be used.
- Use POST when you want Elasticsearch to autogenerate an id for your document.
Syntax:
POST Name-of-the-Index/_doc
{
"field": "value"
}
Example:
POST favorite_candy/_doc
{
"first_name": "Lisa",
"candy": "Sour Skittles"
}
Expected response from Elasticsearch:
- Use PUT when you want to assign a specific id to your document(i.e. if your document has a natural identifier - purchase order number, patient id, & etc). For more detailed explanation, check out this documentation from Elastic!
Syntax:
PUT Name-of-the-Index/_doc/id-you-want-to-assign-to-this-document
{
"field": "value"
}
Example:
PUT favorite_candy/_doc/1
{
"first_name": "John",
"candy": "Starburst"
}
When you index a document using an id that already exists, the existing document is overwritten by the new document. If you do not want a existing document to be overwritten, you can use the _create endpoint!
With the _create Endpoint, no indexing will occur and you will get a 409 error message.
Syntax:
PUT Name-of-the-Index/_create/id-you-want-to-assign-to-this-document
{
"field": "value"
}
Example:
PUT favorite_candy/_create/1
{
"first_name": "Finn",
"candy": "Jolly Ranchers"
}
Expected response from Elasticsearch:
Syntax:
GET Name-of-the-Index/_doc/id-of-the-document-you-want-to-retrieve
Example:
GET favorite_candy/_doc/1
Expected response from Elasticsearch:
If you want to update fields in a document, use the following syntax:
POST Name-of-the-Index/_update/id-of-the-document-you-want-to-update
{
"doc": {
"field1": "value",
"field2": "value",
}
}
Example:
POST favorite_candy/_update/1
{
"doc": {
"candy": "M&M's"
}
}
Expected response from Elasticsearch:
Syntax:
DELETE Name-of-the-Index/_doc/id-of-the-document-you-want-to-delete
Example:
DELETE favorite_candy/_doc/1
Expected response from Elasticsearch:
- Create an index called
destinations
. - Pick five dream travel destinations. For each destination, index a document containing the name and the country.
- Read(GET) each document to check the content of the document.
- Update a field of a document.
- Read(GET) the updated document to ensure that the field has been updated.
- Delete a document of one place.
- Copy and paste the following request to return all documents from the
destinations
index. This is a great way to check whether all the CRUD operations you have performed thus far have worked!
GET destinations/_search
{
"query": {
"match_all": {}
}
}