Free Sample
+ Collection

ElasticSearch Cookbook

Alberto Paro

As a user of ElasticSearch in your web applications you’ll already know what a powerful technology it is, and with this book you can take it to new heights with a whole range of enhanced solutions from plugins to scripting.
RRP $32.99
RRP $54.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782166627
Paperback422 pages

About This Book

  • Write native plugins to extend the capabilities of ElasticSearch to boost your business
  • Integrate the power of ElasticSearch in your Java applications using the native API or Python applications, with the ElasticSearch community client
  • Step-by step-instructions to help you easily understand ElasticSearch’s capabilities, that act as a good reference for everyday activities

Who This Book Is For

If you are a developer who implements ElasticSearch in your web applications, manage data, or have decided to start using ElasticSearch, this book is ideal for you. This book assumes that you’ve got working knowledge of JSON and Java.

Table of Contents

Chapter 1: Getting Started
Understanding node and cluster
Understanding node services
Managing your data
Understanding cluster, replication, and sharding
Communicating with ElasticSearch
Using the HTTP protocol
Using the Native protocol
Using the Thrift protocol
Chapter 2: Downloading and Setting Up ElasticSearch
Downloading and installing ElasticSearch
Networking setup
Setting up a node
Setting up ElasticSearch for Linux systems (advanced)
Setting up different node types (advanced)
Installing a plugin
Installing a plugin manually
Removing a plugin
Changing logging settings (advanced)
Chapter 3: Managing Mapping
Using explicit mapping creation
Mapping base types
Mapping arrays
Mapping an object
Mapping a document
Using dynamic templates in document mapping
Managing nested objects
Managing a child document
Mapping a multifield
Mapping a GeoPoint field
Mapping a GeoShape field
Mapping an IP field
Mapping an attachment field
Adding generic data to mapping
Mapping different analyzers
Chapter 4: Standard Operations
Creating an index
Deleting an index
Opening/closing an index
Putting a mapping in an index
Getting a mapping
Deleting a mapping
Refreshing an index
Flushing an index
Optimizing an index
Checking if an index or type exists
Managing index settings
Using index aliases
Indexing a document
Getting a document
Deleting a document
Updating a document
Speeding up atomic operations (bulk)
Speeding up GET
Chapter 5: Search, Queries, and Filters
Executing a search
Sorting a search
Highlighting results
Executing a scan query
Suggesting a correct query
Deleting by query
Matching all the documents
Querying/filtering for term
Querying/filtering for terms
Using a prefix query/filter
Using a Boolean query/filter
Using a range query/filter
Using span queries
Using the match query
Using the IDS query/filter
Using the has_child query/filter
Using the top_children query
Using the has_parent query/filter
Using a regexp query/filter
Using exists and missing filters
Using and/or/not filters
Using the geo_bounding_box filter
Using the geo_polygon filter
Using the geo_distance filter
Chapter 6: Facets
Executing facets
Executing terms facets
Executing range facets
Executing histogram facets
Executing date histogram facets
Executing filter/query facets
Executing statistical facets
Executing term statistical facets
Executing geo distance facets
Chapter 7: Scripting
Installing additional script plugins
Sorting using script
Computing return fields with scripting
Filtering a search via scripting
Updating with scripting
Chapter 8: Rivers
Managing a river
Using the CouchDB river
Using the MongoDB river
Using the RabbitMQ river
Using the JDBC river
Using the Twitter river
Chapter 9: Cluster and Nodes Monitoring
Controlling cluster health via API
Controlling cluster state via API
Getting nodes information via API
Getting node statistic via API
Installing and using BigDesk
Installing and using ElasticSerach-head
Installing and using SemaText SPM
Chapter 10: Java Integration
Creating an HTTP client
Creating a native client
Managing indices with the native client
Managing mappings
Managing documents
Managing bulk action
Creating a query
Executing a standard search
Executing a facet search
Executing a scroll/scan search
Chapter 11: Python Integration
Creating a client
Managing indices
Managing mappings
Managing documents
Executing a standard search
Executing a facet search
Chapter 12: Plugin Development
Creating a site plugin
Creating a simple plugin
Creating a REST plugin
Creating a cluster action
Creating an analyzer plugin
Creating a river plugin

What You Will Learn

  • Choose the best ElasticSearch cloud topology to deploy and power it up with external plugins
  • Control the index steps with tailored mappings
  • Manage indices and documents and build a complex query against them
  • Execute facets to compute analytics against your data to improve searches and results
  • Use scripting to bypass limits of search, facets, and updates
  • Synchronize and populate data from different data sources, by managing rivers (SQL, NoSQL, web)
  • Monitor the cluster and node performances, and execute common tasks via web interfaces
  • Integrate ElasticSearch in Python and Java applications
  • Extend the capabilities of ElasticSearch by writing your own plugin to add REST calls, rivers, and custom cluster actions

In Detail

ElasticSearch is one of the most promising NoSQL technologies available and is built to provide a scalable search solution with built-in support for near real-time search and multi-tenancy.

This practical guide is a complete reference for using ElasticSearch and covers 360 degrees of the ElasticSearch ecosystem. We will get started by showing you how to choose the correct transport layer, communicate with the server, and create custom internal actions for boosting tailored needs.

Starting with the basics of the ElasticSearch architecture and how to efficiently index, search, and execute analytics on it, you will learn how to extend ElasticSearch by scripting and monitoring its behaviour.

Step-by-step, this book will help you to improve your ability to manage data in indexing with more tailored mappings, along with searching and executing analytics with facets. The topics explored in the book also cover how to integrate ElasticSearch with Python and Java applications.

This comprehensive guide will allow you to master storing, searching, and analyzing data with ElasticSearch.


Read More