diff --git a/README.rst b/README.rst index 43b8e866..44c22b4f 100644 --- a/README.rst +++ b/README.rst @@ -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}