Introduction to Searching

May 15, 2016 by
Part 19 of 35 in the Complete Guide to Elasticsearch series

Before we will get into actually performing searches against an Elasticsearch cluster, I want to introduce the basic concepts of searching in Elasticsearch. In this post, I will talk about relevancy and scoring in Elasticsearch. I will also briefly introduce the two ways of searching, as well as the various types of queries. Relevancy &… read more

Retrieving Documents by ID

January 17, 2016 by
Part 18 of 35 in the Complete Guide to Elasticsearch series

Now that we have added and manipulated documents within our Elasticsearch index, let’s now see how we can retrieve data from it. The easiest way of retrieving data in Elasticsearch, is by retrieving documents by ID. You actually saw this in the previous article if you were paying attention (gotcha!). Simply specify the ID of… read more

Batch Processing

January 17, 2016 by
Part 17 of 35 in the Complete Guide to Elasticsearch series

In the previous articles, we saw how to add, replace, update and delete individual documents. In this lecture, you will see how to perform these operations in batches. To do this, we will use something called the _bulk API. Performing operations in batches is very efficient because it limits the amount of network overhead. This is because… read more

Deleting Documents

January 17, 2016 by
Part 16 of 35 in the Complete Guide to Elasticsearch series

Now that we have added, replaced and updated a document, it is time to see how we can delete it. As you might have guessed, this can be done by using the DELETE HTTP verb. DELETE /ecommerce/product/1001 By default, it is only possible to delete documents by ID. However, there is a plugin named delete-by-query,… read more

Updating Documents

January 17, 2016 by
Part 15 of 35 in the Complete Guide to Elasticsearch series

Now instead of replacing a document, often times you will want to update it with some new information. Instead of replacing our entire product in order to change the price, we can just… well, change the price! This means that we don’t have to supply all of the fields again, but that we only have to pass in… read more

Adding Test Data

January 17, 2016 by
Part 12 of 35 in the Complete Guide to Elasticsearch series

Now that we have added mappings to our index, let’s add some test data to it so that we have some data to search in the remainder of the series. To do this, I will open up the terminal and issue an HTTP request with cURL, where I will be importing a JSON file. You… read more

Adding Mappings

January 17, 2016 by
Part 11 of 35 in the Complete Guide to Elasticsearch series

Now we are going to add a mapping to our ecommerce index. To do that, we are first going to remove the index and add it once again with the mapping. The reason why we are doing this, is that if you have data in an index, then you need to create a new index and… read more