Book Image

Elasticsearch 7 Quick Start Guide

By : Anurag Srivastava, Douglas Miller
Book Image

Elasticsearch 7 Quick Start Guide

By: Anurag Srivastava, Douglas Miller

Overview of this book

Elasticsearch is one of the most popular tools for distributed search and analytics. This Elasticsearch book highlights the latest features of Elasticsearch 7 and helps you understand how you can use them to build your own search applications with ease. Starting with an introduction to the Elastic Stack, this book will help you quickly get up to speed with using Elasticsearch. You'll learn how to install, configure, manage, secure, and deploy Elasticsearch clusters, as well as how to use your deployment to develop powerful search and analytics solutions. As you progress, you'll also understand how to troubleshoot any issues that you may encounter along the way. Finally, the book will help you explore the inner workings of Elasticsearch and gain insights into queries, analyzers, mappings, and aggregations as you learn to work with search results. By the end of this book, you'll have a basic understanding of how to build and deploy effective search and analytics solutions using Elasticsearch.
Table of Contents (10 chapters)

Search API

The search API performs a search using a query string, a parameter, or a request body as the search criteria, and then it returns exact matches. The multi-index syntax is used by most search APIs to search over multiple indices, as follows:

  • Users can search all of the documents in a specific index using the cactus_flower user:
GET facebook/_search?q=user:cactus_flower
  • This can also be applied using a tag:
GET facebook/_search?q=tag:wow
  • To search all the indices, use the _all tag instead of the index name:
GET _all/_search?q=tag:wow

In the preceding query, we can query through all the available Elasticsearch indices for the tag using wow. Now, let's see how we can perform a URI-based search in Elasticsearch.

URI search