2 Getting started

 

This chapter covers

  • Indexing sample documents with Elasticsearch
  • Retrieving, deleting, and updating documents
  • Searching with basic to advanced queries
  • Running aggregations on data

This chapter is all about experiencing a taste of Elasticsearch. Elasticsearch is a Java binary that is available to download from the Elastic company’s website. Once the server is installed and up and running, we can load in our business data, which is analyzed and persisted by Elasticsearch. After priming Elasticsearch with the data, we can execute search queries as well as aggregations on that data.

Although any client capable of invoking REST calls (cURL, Postman, programming SDKs, etc.) can talk to Elasticsearch, we use Kibana as our preferred client throughout this book. Kibana is a rich UI web application from Elastic. It is a visual editor that comes with all the bells and whistles to help discover, analyze, manage, and maintain our cluster and data. With Kibana, we get abundant capabilities such as advanced analytical and statistical functions, rich visualizations and dashboards, machine learning models, and more. As Elasticsearch exposes all its functionality via RESTful APIs, we can construct queries using these APIs in the Kibana editor and communicate with the server over HTTP.

2.1 Priming Elasticsearch with data

2.1.1 An online bookstore

2.1.2 Indexing documents

2.1.3 Indexing our first document

2.1.4 Indexing more documents

2.2 Retrieving data

2.2.1 Counting documents

2.2.2 Retrieving documents

2.3 Full-text search

2.3.1 Match query: Books by an author

2.3.2 Match query with the AND operator