February 2018
Beginner to intermediate
364 pages
10h 32m
English
We will make a few small changes to our API code. The code from the previous recipe has been copied into 09/04/api.py, with the few modifications made.
from elasticsearch import Elasticsearch
class JobListing(Resource): def get(self, job_listing_id): print("Request for job listing with id: " + job_listing_id) listing = get_job_listing_info(job_listing_id) es = Elasticsearch() es.index(index='joblistings', doc_type='job-listing', id=job_listing_id, body=listing) print("Got the following listing as a response: " + listing) return ...
Read now
Unlock full access