Chapter 10. Java Integration

In this chapter we will cover the following recipes:

  • Creating an HTTP client
  • Creating a native client
  • Managing indices with the native client
  • Managing mappings
  • Managing documents
  • Managing bulk actions
  • Building a query
  • Executing a standard search
  • Executing a search with aggregations
  • Executing a scroll/scan search

Introduction

ElasticSearch functionalities can be easily integrated in any Java application in several ways, both via the REST API and native ones.

With the use of Java it's easy to call a REST HTTP interface with one of the many libraries available, such as Apache HttpComponents Client (http://hc.apache.org/). In this field there's no such thing as a most-used library; typically developers choose the library that suits ...

Get ElasticSearch Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.