Bo Andersen
I am a back-end web developer with a passion for open source technologies. I have been a PHP developer for many years, and also have experience with Java and Spring Framework. I currently work full time as a lead developer. Apart from that, I also spend time on making online courses, so be sure to check those out!
Posts by Bo Andersen
Searching with Query DSL: Term Level Queries
Now that we’ve got full text queries covered, let’s take a look at term level queries. As I mentioned in the introduction to searching in Elasticsearch, term level queries are used for exact matching of values. This means that search queries are not analyzed before matching as is the case for full text queries. This… read more
Searching with Query DSL: Full Text Queries
Now that we have taken a look at how to search with query strings, I will now show you how to perform searches by defining queries within the request body in JSON. This approach is referred to as the Query DSL. The first query I am going to show you, is a query that matches… read more
Searching with Query Strings – Remarks
In this short article, I will just mention a few things about the query string approach, before I will move on to showing you how to search with the query DSL. Firstly, I want to mention that any special characters that you include in query string searches must be escaped with a backslash. Special characters… read more
Searching with Query Strings: Phrase Query
In this article, we will be talking about using the phrase query when searching with query strings. By default, all terms are optional, as long as at least one term matches. This is because the default boolean operator is OR. We can see this if we search for pasta spaghetti. GET /ecommerce/product/_search?q=name:pasta spaghetti If we take… read more
Searching with Query Strings: Bool query
Now that you have seen how to search all or specific fields, let’s take a look at how we can embed boolean logic into the query string. Let’s search the name field as we did in the previous article, but this time add parenthesis. Within the parenthesis, we will add the pasta term, followed by a boolean operator.… read more
Searching with Query Strings – Basics
In this post, we will take a look at searching through the use of query strings in the URI. The query string API is powerful and contains many features, so I am just going to show you the basic and most important ways to use it. If you need a complete walkthrough of the query… read more
Introduction to Searching
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
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
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
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