Reader small image

You're reading from  Elasticsearch 7 Quick Start Guide

Product typeBook
Published inOct 2019
PublisherPackt
ISBN-139781789803327
Edition1st Edition
Right arrow
Authors (2):
Anurag Srivastava
Anurag Srivastava
author image
Anurag Srivastava

Anurag Srivastava is a senior technical lead in a multinational software company. He has more than 12 years' experience in web-based application development. He is proficient in designing architecture for scalable and highly available applications. He has handled development teams and multiple clients from all over the globe over the past 10 years of his professional career. He has significant experience with the Elastic Stack (Elasticsearch, Logstash, and Kibana) for creating dashboards using system metrics data, log data, application data, and relational databases. He has authored three other booksMastering Kibana 6.x, and Kibana 7 Quick Start Guide, and Learning Kibana 7 - Second Edition, all published by Packt.
Read more about Anurag Srivastava

Douglas Miller
Douglas Miller
author image
Douglas Miller

Douglas Miller is an expert in helping fast-growing companies to improve performance and stability, and in building search platforms using Elasticsearch. Clients (including Walgreens, Nike, Boeing, and Dish Networks) have seen sales increase, fast performance times, and lower overall costs in terms of the total costs of ownership for their Elasticsearch clusters.
Read more about Douglas Miller

View More author details
Right arrow

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

...

Summary

In this chapter, we have learned about data search in Elasticsearch. We covered URI search and body search so that we could explain how we can perform these searches. Then we covered query examples using term, from/size, sort, and source filtering. We also covered highlighting, rescoring, search type, and named queries. After that, we covered the APIs for the search shard, multi search, count, validate, explain, Profile, and field capabilities.

In the next chapter, we will cover data sparsity and how to improve the performance of Elasticsearch.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Elasticsearch 7 Quick Start Guide
Published in: Oct 2019Publisher: PacktISBN-13: 9781789803327
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.
undefined
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

Authors (2)

author image
Anurag Srivastava

Anurag Srivastava is a senior technical lead in a multinational software company. He has more than 12 years' experience in web-based application development. He is proficient in designing architecture for scalable and highly available applications. He has handled development teams and multiple clients from all over the globe over the past 10 years of his professional career. He has significant experience with the Elastic Stack (Elasticsearch, Logstash, and Kibana) for creating dashboards using system metrics data, log data, application data, and relational databases. He has authored three other booksMastering Kibana 6.x, and Kibana 7 Quick Start Guide, and Learning Kibana 7 - Second Edition, all published by Packt.
Read more about Anurag Srivastava

author image
Douglas Miller

Douglas Miller is an expert in helping fast-growing companies to improve performance and stability, and in building search platforms using Elasticsearch. Clients (including Walgreens, Nike, Boeing, and Dish Networks) have seen sales increase, fast performance times, and lower overall costs in terms of the total costs of ownership for their Elasticsearch clusters.
Read more about Douglas Miller