Add example with namespaces and ignore param

This commit is contained in:
Honza Král
2014-04-24 15:09:32 +02:00
parent 4bfc89409f
commit d1b5acba93
+4
View File
@@ -36,6 +36,10 @@ Simple use-case::
# by default we connect to localhost:9200
>>> es = Elasticsearch()
# create an index in elasticsearch, ignore status code 400 (index already exists)
>>> es.indices.create(index='my-index', ignore=400)
{u'acknowledged': True}
# datetimes will be serialized
>>> es.index(index="my-index", doc_type="test-type", id=42, body={"any": "data", "timestamp": datetime.now()})
{u'_id': u'42', u'_index': u'my-index', u'_type': u'test-type', u'_version': 1, u'ok': True}