There's more...

Let's look briefly at a few more facets of what Elasticsearch has done for us by looking at the results of this document retrieval. 

First, we can see the index, document type, and ID in the first few lines of the result:

{ "_index": "joblistings", "_type": "job-listing", "_id": "122517",

This makes a retrieval of a document very efficient when using these three values as we did in this query.

There is also a version stored for each document, which in this case is 1.

    "_version": 1,

If we do this same query with the code remaining as it is, then this document will be stored again with the same index, doc type, and ID, and hence will have the version incremented.  Trust me, do the curl on the API again, and you will see this ...

Get Python Web Scraping Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.