11Python Elasticsearch Client
22===========================
33
4- Official low-level client for Elasticsearch. It's goal is to provide common
4+ Official low-level client for Elasticsearch. Its goal is to provide common
55ground for all Elasticsearch-related code in Python; because of this it tries
66to be opinion-free and very extendable.
77
8+ Compatibility
9+ -------------
10+
11+ The library is compatible with both Elasticsearch 1.x and 0.90.x but you
12+ **have to use a matching version **.
13+
14+ For **Elasticsearch 1.0 ** and later, use the major version 1 (``1.x.y ``) of the
15+ library.
16+
17+ For **Elasticsearch 0.90.x **, use a version from ``0.4.x `` releases of the
18+ library.
19+
20+ The recommended way to set your requirements in your `setup.py ` or
21+ `requirements.txt ` is::
22+
23+ # Elasticsearch 1.0
24+ elasticsearch>=1.0.0,<2.0.0
25+
26+ # Elasticsearch 0.90
27+ elasticsearch<1.0.0
28+
29+ The development is happening on ``master `` and ``0.4 `` branches, respectively.
30+
31+
32+ Installation
33+ ------------
34+
35+ Install the ``elasticsearch `` package with `pip
36+ <https://pypi.python.org/pypi/elasticsearch> `_::
37+
38+ pip install elasticsearch
39+
840
941Example use
1042-----------
@@ -17,6 +49,10 @@ Simple use-case::
1749 # by default we connect to localhost:9200
1850 >>> es = Elasticsearch()
1951
52+ # create an index in elasticsearch, ignore status code 400 (index already exists)
53+ >>> es.indices.create(index='my-index', ignore=400)
54+ {u'acknowledged': True}
55+
2056 # datetimes will be serialized
2157 >>> es.index(index="my-index", doc_type="test-type", id=42, body={"any": "data", "timestamp": datetime.now()})
2258 {u'_id': u'42', u'_index': u'my-index', u'_type': u'test-type', u'_version': 1, u'ok': True}
@@ -39,7 +75,7 @@ The client's features include:
3975 decoded for performance reasons)
4076 * configurable automatic discovery of cluster nodes
4177 * persistent connections
42- * load balancing (with pluggable selection strategy) across all availible nodes
78+ * load balancing (with pluggable selection strategy) across all available nodes
4379 * failed connection penalization (time based - failed connections won't be
4480 retried until a timeout is reached)
4581 * thread safety
@@ -69,5 +105,3 @@ Build status
69105.. image :: https://secure.travis-ci.org/elasticsearch/elasticsearch-py.png
70106 :target: http://travis-ci.org/#!/elasticsearch/elasticsearch-py
71107
72- .. image :: https://coveralls.io/repos/elasticsearch/elasticsearch-py/badge.png?branch=master
73- :target: https://coveralls.io/r/elasticsearch/elasticsearch-py
0 commit comments