February 2018
Beginner to intermediate
364 pages
10h 32m
English
We proceed with the recipe as follows:
from sojobs.scraping import get_job_listing_infofrom elasticsearch import Elasticsearchimport jsonif __name__ == "__main__": es = Elasticsearch() job_ids = ["122517", "163854", "138222", "164641"] for job_id in job_ids: if not es.exists(index='joblistings', doc_type='job-listing', id=job_id): listing = get_job_listing_info(job_id) es.index(index='joblistings', doc_type='job-listing', id=job_id, body=listing) search_definition = { "query": { "match": { "JSON.skills": { "query": "c#" } } } } result = es.search(index="joblistings", doc_type="job-listing", body=search_definition) print(json.dumps(result, indent=4))
The ...
Read now
Unlock full access