Complete Guide to Elasticsearch
4.5 (10,138 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
50,061 students enrolled

Complete Guide to Elasticsearch

Learn Elasticsearch from scratch and begin learning the ELK stack (Elasticsearch, Logstash & Kibana) and Elastic Stack.
4.5 (10,138 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
50,061 students enrolled
Created by Bo Andersen
Last updated 8/2020
English [Auto], French [Auto], 6 more
  • German [Auto]
  • Indonesian [Auto]
  • Italian [Auto]
  • Polish [Auto]
  • Portuguese [Auto]
  • Spanish [Auto]
Current price: $86.99 Original price: $124.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 12 hours on-demand video
  • 3 articles
  • 3 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Assignments
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • How to build a powerful search engine with Elasticsearch
  • The theory of Elasticsearch and how it works under-the-hood
  • Write complex search queries
  • Be proficient with the concepts and terminology of Elasticsearch
Course content
Expand all 143 lectures 12:13:29
+ Introduction
5 lectures 43:35

Introduction to the course and to what you will learn.

Preview 06:27

What is Elasticsearch all about? How does it work, why is it so popular, and who uses it? There are many questions to be asked, and many answers to be given. Get the answers in this lecture.

Preview 06:36

This lecture walks through the components of the Elastic Stack, giving you an overview of how these fit together with Elasticsearch.

Preview 17:46

Test your understanding of what the purpose of each part of the Elastic Stack is.

Understanding of the Elastic Stack
4 questions

In this lecture, we take a look at some common use cases for the Elastic Stack, and how a simple architecture might evolve over time to incorporate more components of the Elastic Stack.

Preview 10:57

What the Q&A is for, and what it isn't for.

Guidelines for the course Q&A
+ Getting Started
15 lectures 01:41:52

When it comes to installing Elasticsearch and Kibana, you have a number of options. Check out this quick overview to help decide which approach is best for you.

Preview 02:35

Running Elasticsearch and Kibana in Elastic Cloud is the easiest way to get up and running quickly.

Preview 08:09

Learn how to install Elasticsearch on macOS and Linux.

Preview 05:01

Learn how to install Elasticsearch on Windows.

Preview 05:14

Having installed Elasticsearch, let's take a quick tour of what the directory contains.

Preview 06:51

Learn how to install Kibana on macOS and Linux.

Preview 03:29

Learn how to install Kibana on Windows.

Preview 03:25

Understand the basic architecture of Elasticsearch, including what nodes, indices, and documents are.

Preview 06:57

Let's take a moment to see what the cluster that we started up looks like internally.

Preview 07:34

Using Kibana's Console tool is not the only way you can send requests to Elasticsearch's REST API. Learn how to do the same with the cURL HTTP client in this lecture.

Preview 05:35

Learn what sharding is, and how it helps scale an Elasticsearch cluster, both in terms of data volume and query throughput.

Sharding and scalability

Let's be sure that you understand the most important concepts of sharding.

3 questions

Learn what replication is, and how it helps ensure high availability as well as increased query throughput.

Understanding replication

Let's be sure that you understand the most important concepts of replication.

6 questions

Learn how to form a multi-node cluster for development purposes.

Adding more nodes to the cluster (for development)

Elasticsearch nodes have roles, which can be configured for each node. Get an overview of which roles are available, and when you should use them.

Overview of node roles

Let's take a quick moment to wrap up this section of the course.

Wrap up
+ Managing Documents
18 lectures 01:23:46

Before adding some data into our cluster, let's see how to both create and delete indices. When creating an index, we will supply two settings for specifying the number of shards and replica shards for the index.

Creating & deleting indices

In this lecture, you will learn how to index documents in two ways; by having Elasticsearch generate an ID for documents automatically, and by specifying an ID ourselves.

Indexing documents

Learn how to retrieve a document based on its ID.

Retrieving documents by ID

Learn how to update an existing field's value, and how to add a new field to a document.

Updating documents

Learn how to update documents with scripts. Scripts enable us to update documents dynamically, such as by performing calculations on field values. You will also see how to include parameters within scripts. Lastly, you will learn how to ignore a given document during an update, how to conditionally update a document, and how to delete a document within a script.

Scripted updates

In this lecture, we will cover so-called upserts. An upsert is a way to index a document or update an existing one, depending on whether or not a given document already exists.


Apart from updating documents, we can also replace them altogether. You will learn how to do just that in this lecture.

Replacing documents

The last document action you need to learn, is to delete documents. Fortunately, this is extremely easy due to Elasticsearch's REST API.

Deleting documents

How did Elasticsearch find the documents that we have indexed in the previous lectures? And how did it know where to store the documents that we indexed? That's what we will be looking at in this lecture.

Understanding routing

Now that you know what routing is, let's take a closer look at how Elasticsearch reads data. This involves a coordinating node and Adaptive Replica Selection (ARS).

How Elasticsearch reads data

Now that you know how Elasticsearch reads data, let's talk about how it writes data. That's a more complicated subject involving something called primary terms, sequence numbers, as well as global and local checkpoints. We will also cover the basics of how data is replicated to replica shards.

How Elasticsearch writes data

Elasticsearch uses a primitive kind of document versioning. Let's take a look at what that is all about.

Understanding document versioning

Documents might be overwritten inadvertently due to a web server running multiple threads in parallel, for instance. How do we deal with this problem? We first look at how we used to handle this, before diving into how primary terms and sequence numbers can be used to overcome this challenge.

Optimistic concurrency control

Let's see how we can update multiple documents with a single query, similar to an UPDATE WHERE query for relational databases. We will also go through the inner workings of the query, including how it handles errors and performs optimistic concurrency control.

Update by query

Now that you know how to update multiple documents with one query, let's do the same thing, just in regards to deleting documents.

Delete by query

Learn how to process multiple (potentially thousands or millions) actions within one query. This can be used to index, update, or delete many documents at the same time.

Batch processing

It's time to import some test data. Learn how to import data by using the Bulk API together with cURL on the command line.

Importing data with cURL

Let's take a quick moment to wrap up this section of the course.

Wrap up
+ Mapping & Analysis
34 lectures 03:14:52

Quick introduction to what is covered in this section of the course.

Introduction to this section

Introduction to the concept of text analysis.

Introduction to analysis

Learn how to use the Analyze API to test built-in and custom analyzers. It can also be used to test character filters, tokenizers, and token filters.

Using the Analyze API

Learn how text values are analyzed and stored within a data structure called an inverted index.

Understanding inverted indices

Introduction to the concept of mapping.

Introduction to mapping

An overview of the most important data types in Elasticsearch, with a focus on the "object," "nested," and "keyword" data types.

Overview of data types

Let's take a closer look at how the "keyword" data type works and learn why it is used for exact matches, aggregations, and sorting.

How the "keyword" data type works

Learn what type coercion is all about and how Elasticsearch can sometimes convert from one data type to another.

Understanding type coercion

How can we index array values into Elasticsearch? How do arrays work, and what are their limitations? Learn the answers to those questions in this lecture.

Understanding arrays

Time to add our first mapping to an index.

Adding explicit mappings

Learn how to retrieve mappings for an index, and also specific field mappings.

Retrieving mappings

Mapping queries can be simplified when using a dot notation syntax for nested fields. Learn how to do that in this lecture.

Using dot notation in field names

Sometimes you might want to add field mappings to an existing index. Learn how to do that in this lecture.

Adding mappings to existing indices

Let's take a look at how Elasticsearch handles dates. In particular, which date formats are supported, how timezones work, how Elasticsearch stores dates internally, and how dates are searched by search queries.

How dates work in Elasticsearch

What happens if we leave out a field when indexing a document? And does adding a field mapping make a field required? Those are some of the questions that we will answer in this lecture.

How missing fields are handled

In this lecture, we take a look at the most important mapping parameters, including "doc_values," "norms," "index," and more.

Overview of mapping parameters

In this lecture you will learn how to update existing field mappings. There are quite a few limitations to updating mappings in Elasticsearch, so we will cover those as well.

Updating existing mappings

Let's see how we can reindex documents into a new index. We will take a look at how the Reindex API works and cover a number of common use cases with examples.

Reindexing documents with the Reindex API

Instead of renaming fields, we can make use of field aliases. You will see how to add and use field aliases in this lecture.

Defining field aliases

An Elasticsearch field can actually be mapped in multiple ways. This is very useful for querying field values in different ways.

Multi-field mappings

Index templates can be used to specify field mappings and index settings. These can then automatically be applied to new indices based on index patterns. We will take a look at common usages of index templates, among others.

Index templates

In this lecture, we will look at how the Elastic Common Schema (ECS) defines a large number of common fields and their data types. We will also take a look at why ECS was created, and when it is useful.

Introduction to the Elastic Common Schema (ECS)

Time to get into dynamic mapping now. We will take a look at the rules that Elasticsearch uses when dynamically mapping fields, along with a couple of examples.

Introduction to dynamic mapping

Now that you know of both explicit and dynamic mapping, what about combining them? As you will see, you don't necessarily have to choose either explicit or dynamic mapping.

Combining explicit and dynamic mapping

Let's take a look at how we can configure dynamic mapping. You will see how to disable it, how to set it to "strict," and how inheritance is supported. Apart from that, we will also look at numeric detection and date detection.

Configuring dynamic mapping

Dynamic mapping can be configured with dynamic templates. These templates define certain conditions, and when they are matched, the specified mapping will be applied.

Dynamic templates

Before moving on to analysis and analyzers, I have a few recommendations in regards to mapping.

Mapping recommendations

Stemming and stop words are two common things to handle during text analysis. We will look at how words can be stemmed to their root form as a way to improve search results. We will also cover the concept of removing stop words.

Stemming & stop words

If terms are changed during the analysis process (e.g. stemmed or stop words being removed), how do searches work? Find the answer in this lecture.

Analyzers and search queries

Let's go through the most important built-in analyzers and also cover how to configure and use them.

Built-in analyzers

In this lecture, we are going to build a custom analyzer. As part of that, I will show you how to configure a built-in token filter as well.

Creating custom analyzers

Apart from specifying analyzers when creating a new index, sometimes we might need to add an analyzer to an existing index. Let's see how to do that in this lecture. In the process, we will look at opening and closing indices, as well as static and dynamic index settings.

Adding analyzers to existing indices

Let's take a look at how to update analyzers. While doing so is easy, there is a very important thing to be aware of; failing to handle the situation correctly, can potentially lead to big problems.

Updating analyzers

A quick wrap up of this section.

Wrap up
+ Introduction to Searching
10 lectures 36:30

A quick recommendation in regards to types.

A word on document types

Quick rundown of the two methods of searching data in Elasticsearch; request URI searches (query string), and the Query DSL.

Search methods

A few examples of searching for data with query string searches (request URI).

Searching with the request URI

An introduction to searching with the Query DSL.

Introducing the Query DSL

Explanation of how a search query is handled within an Elasticsearch cluster.

How searching works

Taking a closer look at search query results.

Understanding query results

An explanation of how relevance scores are calculated.

Understanding relevance scores

See how to use the Explain API to debug why a given did or didn't match a given document.

Debugging unexpected search results

Understand the two contexts in which search queries can be executed in Elasticsearch and what the differences are.

Query contexts

Before diving into the various categories of search queries, let's take a look at the difference between full-text queries and term level queries.

Full text queries vs term level queries

Test your understanding of the basics of searching for data in Elasticsearch.

Basics of searching
4 questions
+ Term Level Queries
10 lectures 26:52

Introduction to the concept of term level queries and when to use them.

Introduction to term level queries

Let's start out simple by searching for a term with the "term" query.

Searching for a term

In this lecture, we search for multiple terms with the "terms" query.

Searching for multiple terms

This lecture shows how to retrieve multiple documents at once by IDs.

Retrieving documents based on IDs

This lecture covers matching documents with range values.

Matching documents with range values

This lecture shows how to use date math and relative dates when searching date fields.

Working with relative dates (date math)

See how to match documents that contain non-null values. In this lecture, we search for documents containing at least one tag.

Matching documents with non-null values

See how to match documents where a given field's value begins with a specified prefix.

Matching based on prefixes

Searching with wildcards, being a question mark or an asterisk.

Searching with wildcards

See how to supply a regular expression that is then used for matching field values.

Searching with regular expressions
Let's put what you just learned about term level queries to use by writing a couple of example queries.
Term Level Queries
6 questions
+ Full Text Queries
4 lectures 11:24

Introduction to what full text queries are all about, and an introduction to the new test data that we will be working with throughout this section of the course.

Introduction to full text queries

Learn the fundamentals of the "match" query, which is probably the most essential query to understand in Elasticsearch.

Flexible matching with the match query

This lecture covers how to search for phrases in Elasticsearch.

Matching phrases

In this lecture, you will learn how to search multiple fields with the same query.

Searching multiple fields
Let's put what you just learned about full text queries to use by writing a couple of example queries.
Full Text Queries
3 questions
+ Adding Boolean Logic to Queries
4 lectures 21:25

Introduction to what compound queries are about.

Introduction to compound queries

See how to write boolean queries with the "bool" query and understand how relevance scores are affected.

Querying with boolean logic

See how named queries can be used to debug and possibly understand the relevance of matching documents.

Debugging bool queries with named queries

You already saw how to use the "match" query, but let's dive a little deeper and talk about how it works internally.

How the “match” query works
+ Joining Queries
13 lectures 59:46

Introduction to this section on joining queries.

Introduction to this section

See how to query nested objects with the nested type. Also learn how this works internally and why this cannot be done without the "nested" query type.

Querying nested objects

See how to figure out which nested objects caused a document to match a given query.

Nested inner hits

Learn how to map document relationships with the "join" field data type.

Mapping document relationships

Learn how to add documents for indices with "join relationships."

Adding documents

Learn how to rRetrieve documents based on their parent's ID.

Querying by parent ID

See how to search for documents whose parent match certain criteria.

Querying child documents by parent

See how to search for documents whose child documents match certain criteria.

Querying parent by child documents

Learn how to add and use multi-level relationships, also referred to as nested relations.

Multi-level relations

See how to include inner hits with queries using a "join" field.

Parent/child inner hits

See how to use the so-called terms lookup mechanism. Essentially a more efficient way of using the "terms" query when dealing with lots of terms.

Terms lookup mechanism

Joining queries are great in some scenarios, but not so great in others. This lecture discusses the pros and cons of using join queries and gives you recommendations about when to use them and when to stay away from them.

Join limitations

Joining queries are often not very fast. This lecture discusses the performance of joining queries and teaches you when performance is going to be an issue, enabling you to determine whether or not the "join" field is the right tool for your particular use case.

Join field performance considerations
+ Controlling Query Results
8 lectures 27:51

See how to choose between JSON and YAML as the result formats, and also how to format JSON for human eyes.

Specifying the result format

Learn how to specify which fields Elasticsearch should return for each match.

Source filtering

See how to specify how many search results Elasticsearch should return for a request.

Specifying the result size

See how to specify a match offset for a request.

Specifying an offset

See how the result size and offset can be combined to implement pagination within an application.


This lecture shows how to sort results in ascending and descending order.

Sorting results

This lecture shows how to sort by multi-value fields, such as average ratings, for example.

Sorting by multi-value fields

See how to apply filters to queries.

  • Knowledge of JSON
  • Basic terminal skills is a plus

Do you want to learn the popular search engine, Elasticsearch, from the beginning and become a professional in no time? This course is an excellent way for you to quickly learn Elasticsearch and to put your knowledge to work in just a few hours! If so, then you have come to the right place, as this is the most comprehensive course on Elasticsearch that you will find online! This course is a great starting point for anyone who wants to learn the ELK stack and Elastic Stack, as Elasticsearch is at the center of both stacks.

Elasticsearch is an extremely popular search engine and will be an excellent addition to your CV - even if you are already familiar with other search engines or frameworks such as Apache Lucene, Apache Solr, Amazon CloudSearch, etc.

Please note that this course is intended for developers who want to interact with an Elasticsearch cluster in one way or another and not system administrators looking to maintain an Elasticsearch cluster in production. The course focuses on functionality relevant to utilize the capabilities of Elasticsearch as a developer.

The course is a combination of theory and learning by doing. Before giving examples of how to perform certain queries, you will have been equipped with the necessary theory in advance. This ensures that you not only know how to perform powerful searches with Elasticsearch, but that you also understand the relevant theory; you will get a deep understanding of how Elasticsearch works under the hood.

The course starts from the absolute beginning, and no knowledge or prior experience with Elasticsearch is required. We will walk through all of the most important aspects of Elasticsearch, and at the end of this course, you will be able to build powerful search engines. This could be for a website where you could build Google-like search functionality, for example.

So, join me in this course and learn to build powerful search engines with Elasticsearch today!

Note that this course does not cover Logstash and Kibana. This is so that I can go into much greater detail with Elasticsearch and focus on that exclusively. This course is therefore dedicated to Elasticsearch. For courses on Logstash and Kibana, please see my other courses.

Who this course is for:
  • Developers who want to learn Elasticsearch. The course is intended for developers and not system administrators.