use now() instead of fixed time
took me a few minutes to figure out why the doc i just added didn't show up in kibana. a more recent timestamp may be friendlier for beginners
This commit is contained in:
committed by
Honza Král
parent
72f661f953
commit
a8d9ffd60b
+1
-1
@@ -46,7 +46,7 @@ Example Usage
|
||||
doc = {
|
||||
'author': 'kimchy',
|
||||
'text': 'Elasticsearch: cool. bonsai cool.',
|
||||
'timestamp': datetime(2010, 10, 10, 10, 10, 10)
|
||||
'timestamp': datetime.now(),
|
||||
}
|
||||
res = es.index(index="test-index", doc_type='tweet', id=1, body=doc)
|
||||
print(res['created'])
|
||||
|
||||
Reference in New Issue
Block a user