Complete Guide to Elasticsearch
4.5 (10,086 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.
49,765 students enrolled

Complete Guide to Elasticsearch

Learn Elasticsearch from scratch and begin learning the ELK stack (Elasticsearch, Logstash & Kibana) and Elastic Stack.
Bestseller
4.5 (10,086 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.
49,778 students enrolled
Created by Bo Andersen
Last updated 8/2020
English
English [Auto], French [Auto], 6 more
  • German [Auto]
  • Indonesian [Auto]
  • Italian [Auto]
  • Polish [Auto]
  • Portuguese [Auto]
  • Spanish [Auto]
Current price: $80.99 Original price: $124.99 Discount: 35% off
18 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
01:49
+ 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
09:27

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

Sharding
3 questions

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

Understanding replication
17:40

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

Replication
6 questions

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

Adding more nodes to the cluster (for development)
08:46

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
09:59

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

Wrap up
01:10
+ 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
03:08

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
04:06

Learn how to retrieve a document based on its ID.

Retrieving documents by ID
01:20

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

Updating documents
03:59

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
07:44

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.

Upserts
02:30

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

Replacing documents
01:26

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
01:01

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
05:18

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
02:34

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
08:03

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

Understanding document versioning
03:22

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
06:32

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
08:52

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
01:52

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
13:53

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
07:14

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

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

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

Introduction to this section
00:42

Introduction to the concept of text analysis.

Introduction to analysis
05:30

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
05:12

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

Understanding inverted indices
06:40

Introduction to the concept of mapping.

Introduction to mapping
02:08

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
08:35

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
04:08

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

Understanding type coercion
05:59

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
05:04

Time to add our first mapping to an index.

Adding explicit mappings
05:32

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

Retrieving mappings
01:35

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
01:49

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
01:52

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
06:05

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
01:44

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

Overview of mapping parameters
14:35

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
04:21

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
12:46

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
03:31

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

Multi-field mappings
06:34

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
07:50

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)
05:30

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
09:02

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
01:34

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
08:02

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
13:22

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

Mapping recommendations
05:15

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
04:08

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
04:22

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

Built-in analyzers
07:38

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
10:00

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
06:11

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
07:08

A quick wrap up of this section.

Wrap up
00:28
+ Introduction to Searching
10 lectures 36:30

A quick recommendation in regards to types.

A word on document types
01:04

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

Search methods
02:17

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

Searching with the request URI
03:50

An introduction to searching with the Query DSL.

Introducing the Query DSL
02:50

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

How searching works
03:42

Taking a closer look at search query results.

Understanding query results
01:57

An explanation of how relevance scores are calculated.

Understanding relevance scores
10:30

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

Debugging unexpected search results
01:43

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

Query contexts
02:40

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
05:57

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
01:10

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

Searching for a term
02:28

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

Searching for multiple terms
01:48

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

Retrieving documents based on IDs
01:07

This lecture covers matching documents with range values.

Matching documents with range values
03:46

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

Working with relative dates (date math)
07:37

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
02:00

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

Matching based on prefixes
01:19

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

Searching with wildcards
02:34

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

Searching with regular expressions
03:03
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
02:23

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

Flexible matching with the match query
04:45

This lecture covers how to search for phrases in Elasticsearch.

Matching phrases
01:38

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

Searching multiple fields
02:38
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
01:09

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

Querying with boolean logic
10:37

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

Debugging bool queries with named queries
03:16

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
06:23
+ Joining Queries
13 lectures 59:46

Introduction to this section on joining queries.

Introduction to this section
02:43

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
05:51

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

Nested inner hits
03:59

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

Mapping document relationships
02:42

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

Adding documents
06:35

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

Querying by parent ID
02:52

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

Querying child documents by parent
05:14

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

Querying parent by child documents
05:55

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

Multi-level relations
09:42

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

Parent/child inner hits
02:00

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
06:11

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
01:42

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
04:20
+ 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
03:01

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

Source filtering
04:26

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

Specifying the result size
01:36

See how to specify a match offset for a request.

Specifying an offset
02:09

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

Pagination
05:04

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

Sorting results
05:16

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

Sorting by multi-value fields
02:27

See how to apply filters to queries.

Filters
03:52
Requirements
  • Knowledge of JSON
  • Basic terminal skills is a plus
Description

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.