Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Elasticsearch 7 Quick Start Guide

You're reading from  Elasticsearch 7 Quick Start Guide

Product type Book
Published in Oct 2019
Publisher Packt
ISBN-13 9781789803327
Pages 186 pages
Edition 1st Edition
Languages
Authors (2):
Anurag Srivastava Anurag Srivastava
Profile icon Anurag Srivastava
Douglas Miller Douglas Miller
Profile icon Douglas Miller
View More author details

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

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}