Book Image

Mastering ElasticSearch

By : Rafał Kuć, Marek Rogoziński
Book Image

Mastering ElasticSearch

By: Rafał Kuć, Marek Rogoziński

Overview of this book

<p>ElasticSearch is fast, distributed, scalable, and written in the Java search engine that leverages Apache Lucene capabilities providing a new level of control over how you index and search even the largest set of data.</p> <p>"Mastering ElasticSearch" covers the intermediate and advanced functionalities of ElasticSearch and will let you understand not only how ElasticSearch works, but will also guide you through its internals such as caches, Apache Lucene library, monitoring capabilities, and the Java API. In addition to that you'll see the practical usage of ElasticSearch configuration parameters, monitoring API, and easy-to-use and extend examples on how to extend ElasticSearch by writing your own plugins.</p> <p>"Mastering ElasticSearch" starts by showing you how Apache Lucene works and what the ElasticSearch architecture looks like. It covers advanced querying capabilities, index configuration control, index distribution, ElasticSearch administration and troubleshooting. Finally you'll see how to improve the user’s search experience, use the provided Java API and develop your own custom plugins.</p> <p>It will help you learn how Apache Lucene works both in terms of querying and indexing. You'll also learn how to use different scoring models, rescoring documents using other queries, alter how the index is written by using custom postings and what segments merging is, and how to configure it to your needs. You'll optimize your queries by modifying them to use filters and you'll see why it is important. The book describes in details how to use the shard allocation mechanism present in ElasticSearch such as forced awareness.</p> <p>"Mastering ElasticSearch" will open your eyes to the practical use of the statistics and information API available for the index, node and cluster level, so you are not surprised about what your ElasticSearch does while you are not looking. You'll also see how to troubleshoot by understanding how the Java garbage collector works, how to control I/O throttling, and see what threads are being executed at the any given moment. If user spelling mistakes are making you lose sleep at night - don't worry anymore the book will show you how to configure and use the ElasticSearch spell checker and improve the query relevance of your queries. Last, but not least you'll see how to use the ElasticSearch Java API to use the ElasticSearch cluster from your JVM based application and you'll extend ElasticSearch by writing your own custom plugins.</p> <p>If you are looking for a book that will allow you to easily extend your basic knowledge about ElasticSearch or you want to go deeper into the world of full text search using ElasticSearch then this book is for you.</p> <p>&nbsp;</p>
Table of Contents (16 chapters)
Mastering ElasticSearch
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Looking deeper into data handling


When starting to work with ElasticSearch, you can be overwhelmed with the different ways of searching and the different query types it provides. Each of these query types behaves differently and we do not say only about obvious differences, for example, like the one you would see when comparing range search and prefix search. It is crucial to know about these differences to understand how the queries work, especially when doing a little more than just using the default ElasticSearch instance, for example, for handling multilingual information.

Input is not always analyzed

Before we start discussing queries analysis, let's create the index by using the following command:

curl -XPUT localhost:9200/test -d '{
  "mappings" : {
    "test" : {
      "properties" : {
        "title" : { "type" : "string", "analyzer" : "snowball" }
      }
    }
  }
}'

As you can see, the index is pretty simple. The document contains only one field, processed by snowball analyzer...