Book Image

Elasticsearch for Hadoop

By : Vishal Shukla
Book Image

Elasticsearch for Hadoop

By: Vishal Shukla

Overview of this book

Table of Contents (15 chapters)
Elasticsearch for Hadoop
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Elastic searching


Now that you know the basics of indexing, how to use the built-in and custom analyzers, how to create mapping, and index new documents, let's see how to query your indexed documents in Elasticsearch.

Writing search queries

Elasticsearch supports various query types with its Query DSL by posting a JSON-based query in the POST request body.

It is beyond the scope of this book to discuss the minute details of each query type and its configurable options. I would highly recommend that you try these queries out with different options and data to understand the query behaviors better. You can use the small dataset script provided at https://raw.githubusercontent.com/vishalbrevitaz/eshadoop/master/ch03/data/setup-hrms.sh to try out the queries mentioned in the following sections.

The URI search

Elasticsearch provides a quick way to search with the GET request by passing a criteria as the query string parameter.

Here is an example to find candidates with the elasticsearch skill:

$ curl...