January 2016
Intermediate to advanced
240 pages
4h 42m
English
All the queries that we have discussed can be performed with the Elasticsearch Python client using the search function. To do this, first store the query inside a variable that is query in the following example:
query = {
"query": {
"match_all": {}
},
}Call the search function with all the parameters including the index name, document type, and query. The size parameter used in the following search request can also be included inside the query itself:
response = es.search(index='twitter', doc_type='tweets', body=query, size=2, request_timeout=20)
To search against more than one index, instead of using a string value, you need to use a list of index names. The same applies for document types too.
The response data comes ...
Read now
Unlock full access