O'Reilly logo

Elasticsearch 5.x Cookbook - Third Edition by Alberto Paro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing a standard search

After inserting documents, the most commonly executed action in Elasticsearch is the search. The official Elasticsearch client APIs for searching are similar to the REST API.

Getting ready

You need an up-and-running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.

You also need the Python installed packages of the Creating a client recipe of this chapter.

The code of this recipe can be found in the chapter_16/searching.py file.

How to do it…

To execute a standard query, the client method search must be called by passing the query parameters, as we have seen in Chapter 5, Search. The required parameters are index_name, type_name and the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required