in sources/lambda/async/document_indexer.py [0:0]
def index(self, document):
""" Index the full document (pages and entities) in elasticsearch """
response = requests.post(elastic_url,
auth=awsauth,
json=document,
headers=headers)
response.raise_for_status()
es_response = response.json()
return es_response["_id"]