Skip to content

Instantly share code, notes, and snippets.

@hunk
Last active May 25, 2020 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunk/f12e635ec6900d5725ddfb9dbe143287 to your computer and use it in GitHub Desktop.
Save hunk/f12e635ec6900d5725ddfb9dbe143287 to your computer and use it in GitHub Desktop.
from elasticsearch import Elasticsearch
es = Elasticsearch(ELASTICSEARCH_URL)
doc = {
'author': 'Patito',
'text': 'Some text here, more text.',
'timestamp': datetime.now(),
}
res = es.index(index="document-index", id=1, body=doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment