Preface - Elasticsearch Server, Second Edition (2014)

Elasticsearch Server, Second Edition (2014)

Preface

Welcome to Elasticsearch Server Second Edition. In the second edition of the book, we decided not only to do the update to match the latest version of Elasticsearch but also to add some additional important sections that we didn't think of while writing the first book. While reading this book, you will be taken on a journey through a wonderful world of full-text search provided by the Elasticsearch server. We will start with a general introduction to Elasticsearch, which covers how to start and run Elasticsearch, what are the basic concepts of Elasticsearch, and how to index and search your data in the most basic way.

This book will also discuss the query language, so-called Querydsl, that allows you to create complicated queries and filter the returned results. In addition to all this, you'll see how you can use faceting to calculate aggregated data based on the results returned by your queries, and how to use the newly introduced aggregation framework (the analytics engine allows you to give meaning to your data). We will implement autocomplete functionality together and learn how to use Elasticsearch spatial capabilities and prospective search.

Finally, this book will show you Elasticsearch administration API capabilities with features such as shard placement control and cluster handling.

What this book covers

Chapter 1, Getting Started with the Elasticsearch Cluster, covers what full-text searching, Apache Lucene, and text analysis are, how to run and configure Elasticsearch, and finally, how to index and search your data in the most basic way.

Chapter 2, Indexing Your Data, shows how indexing works, how to prepare an index structure and what data types we are allowed to use, how to speed up indexing, what segments are, how merging works, and what routing is.

Chapter 3, Searching Your Data, introduces the full-text search capabilities of Elasticsearch by discussing how to query, how the querying process works, and what type of basic and compound queries are available. In addition to this, we will learn how to filter our results, use highlighting, and modify the sorting of returned results.

Chapter 4, Extending Your Index Structure, discusses how to index more complex data structures. We will learn how to index tree-like data types, index data with relationships between documents, and modify the structure of an index.

Chapter 5, Make Your Search Better, covers Apache Lucene scoring and how to influence it in Elasticsearch, the scripting capabilities of Elasticsearch, and language analysis.

Chapter 6, Beyond Full-text Searching, shows the details of the aggregation framework functionality, faceting, and how to implement spellchecking and autocomplete using Elasticsearch. In addition to this, readers will learn how to index binary files, work with geospatial data, and efficiently process large datasets.

Chapter 7, Elasticsearch Cluster in Detail, discusses the nodes discovery mechanism, recovery and gateway Elasticsearch modules, templates and cluster preparation for high indexing, and querying use cases.

Chapter 8, Administrating Your Cluster, covers the Elasticsearch backup functionality, cluster monitoring, rebalancing, and moving shards. In addition to this, you will learn how to use the warm-up functionality, work with aliases, install plugins, and update cluster settings with the update API.

What you need for this book

This book was written using Elasticsearch server Version 1.0.0, and all the examples and functions should work with it. In addition to this, you'll need a command that allows you to send HTTP requests such as cURL, which is available for most operating systems. Please note that all the examples in this book use the mentioned cURL tool. If you want to use another tool, please remember to format the request in an appropriate way that can be understood by the tool of your choice.

In addition to this, some chapters may require additional software such as Elasticsearch plugins, but it has been explicitly mentioned when certain types of software are needed.

Who this book is for

If you are a beginner to the world of full-text search and Elasticsearch, this book is for you. You will be guided through the basics of Elasticsearch, and you will learn how to use some of the advanced functionalities.

If you know Elasticsearch and have worked with it, you may find this book interesting as it provides a nice overview of all the functionalities with examples and description.

If you know the Apache Solr search engine, this book can also be used to compare some functionalities of Apache Solr and Elasticsearch. This may give you the knowledge about the tool, which is more appropriate for your use.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows:

"The postings format is a per-field property, just like type or name."

A block of code is set as follows:

{

"status" : 200,

"name" : "es_server",

"version" : {

"number" : "1.0.0",

"build_hash" : "a46900e9c72c0a623d71b54016357d5f94c8ea32",

"build_timestamp" : "2014-02-12T16:18:34Z",

"build_snapshot" : false,

"lucene_version" : "4.6"

},

"tagline" : "You Know, for Search"

}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

{

"mappings" : {

"post" : {

"properties" : {

"id" : { "type" : "long", "store" : "yes", "precision_step" : "0" },

"name" : { "type" : "string", "store" : "yes", "index" : "analyzed", "similarity" : "BM25" },

"contents" : { "type" : "string", "store" : "no", "index" : "analyzed", "similarity" : "BM25" }

}

}

}

}

Any command-line input or output is written as follows:

curl -XGET http://localhost:9200/blog/article/1

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.