elasticsearch 2.4.0


pip install elasticsearch==2.4.0

Project Links

Meta
Author: Honza Král

Classifiers

Development Status
  • 5 - Production/Stable

License
  • OSI Approved :: Apache Software License

Intended Audience
  • Developers

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 2
  • Python :: 2.6
  • Python :: 2.7
  • Python :: 3
  • Python :: 3.2
  • Python :: 3.3
  • Python :: 3.4
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in Python; because of this it tries to be opinion-free and very extendable.

For a more high level client library with more limited scope, have a look at elasticsearch-dsl - a more pythonic library sitting on top of elasticsearch-py.

It provides a more convenient and idiomatic way to write and manipulate queries. It stays close to the Elasticsearch JSON DSL, mirroring its terminology and structure while exposing the whole range of the DSL from Python either directly using defined classes or a queryset-like expressions.

It also provides an optional persistence layer for working with documents as Python objects in an ORM-like fashion: defining mappings, retrieving and saving documents, wrapping the document data in user-defined classes.

Compatibility

The library is compatible with all Elasticsearch versions since 0.90.x but you have to use a matching major version:

For Elasticsearch 2.0 and later, use the major version 2 (2.x.y) of the library.

For Elasticsearch 1.0 and later, use the major version 1 (1.x.y) of the library.

For Elasticsearch 0.90.x, use a version from 0.4.x releases of the library.

The recommended way to set your requirements in your setup.py or requirements.txt is:

# Elasticsearch 2.x
elasticsearch>=2.0.0,<3.0.0

# Elasticsearch 1.x
elasticsearch>=1.0.0,<2.0.0

# Elasticsearch 0.90.x
elasticsearch<1.0.0

The development is happening on master and 1.x branches, respectively.

Installation

Install the elasticsearch package with pip:

pip install elasticsearch

Example use

Simple use-case:

>>> from datetime import datetime
>>> from elasticsearch import Elasticsearch

# 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}

# but not deserialized
>>> es.get(index="my-index", doc_type="test-type", id=42)['_source']
{u'any': u'data', u'timestamp': u'2013-05-12T19:45:31.804229'}

Full documentation.

Features

The client’s features include:

  • translating basic Python data types to and from json (datetimes are not decoded for performance reasons)

  • configurable automatic discovery of cluster nodes

  • persistent connections

  • load balancing (with pluggable selection strategy) across all available nodes

  • failed connection penalization (time based - failed connections won’t be retried until a timeout is reached)

  • support for ssl and http authentication

  • thread safety

  • pluggable architecture

License

Copyright 2015 Elasticsearch

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Build status

https://secure.travis-ci.org/elastic/elasticsearch-py.png
9.1.1 Sep 12, 2025
9.1.0 Jul 30, 2025
9.0.4 Sep 12, 2025
9.0.3 Jul 30, 2025
9.0.2 Jun 05, 2025
9.0.1 Apr 28, 2025
9.0.0 Apr 15, 2025
8.19.1 Sep 12, 2025
8.19.0 Jul 30, 2025
8.18.1 Apr 29, 2025
8.18.0 Apr 15, 2025
8.17.2 Mar 04, 2025
8.17.1 Jan 23, 2025
8.17.0 Dec 16, 2024
8.16.0 Nov 13, 2024
8.15.1 Sep 10, 2024
8.15.0 Aug 13, 2024
8.14.0 Jun 06, 2024
8.13.2 May 24, 2024
8.13.1 May 03, 2024
8.13.0 Mar 27, 2024
8.12.1 Feb 22, 2024
8.12.0 Jan 19, 2024
8.11.1 Dec 08, 2023
8.11.0 Nov 13, 2023
8.10.1 Oct 13, 2023
8.10.0 Sep 22, 2023
8.9.0 Jul 27, 2023
8.8.2 Jul 06, 2023
8.8.1 Jul 06, 2023
8.8.0 May 25, 2023
8.7.0 Apr 06, 2023
8.6.2 Feb 16, 2023
8.6.1 Jan 27, 2023
8.6.0 Jan 10, 2023
8.5.3 Dec 08, 2022
8.5.2 Nov 23, 2022
8.5.1 Nov 21, 2022
8.5.0 Nov 02, 2022
8.4.3 Oct 06, 2022
8.4.2 Sep 20, 2022
8.4.1 Sep 06, 2022
8.4.0 Aug 25, 2022
8.3.3 Jul 28, 2022
8.3.2 Jul 28, 2022
8.3.1 Jun 30, 2022
8.3.0 Jun 29, 2022
8.2.3 Jun 15, 2022
8.2.2 Jun 01, 2022
8.2.1 Jun 01, 2022
8.2.0 May 03, 2022
8.1.3 Apr 26, 2022
8.1.2 Mar 31, 2022
8.1.1 Mar 22, 2022
8.1.0 Mar 08, 2022
8.0.1 Mar 01, 2022
8.0.0 Feb 10, 2022
8.0.0b2 Feb 03, 2022
8.0.0b1 Jan 18, 2022
8.0.0a4 Jan 04, 2022
8.0.0a3 Dec 09, 2021
8.0.0a2 Dec 03, 2021
8.0.0a1 Nov 29, 2021
7.17.12 Sep 19, 2024
7.17.9 Feb 02, 2023
7.17.8 Dec 08, 2022
7.17.7 Oct 26, 2022
7.17.6 Aug 25, 2022
7.17.5 Aug 25, 2022
7.17.4 Jun 01, 2022
7.17.3 Apr 26, 2022
7.17.2 Mar 31, 2022
7.17.1 Feb 28, 2022
7.17.0 Feb 01, 2022
7.16.3 Jan 13, 2022
7.16.2 Dec 27, 2021
7.16.1 Dec 13, 2021
7.16.0 Dec 07, 2021
7.15.2 Nov 10, 2021
7.15.1 Oct 14, 2021
7.15.0 Sep 22, 2021
7.15.0a1 Sep 09, 2021
7.14.2 Sep 21, 2021
7.14.1 Sep 01, 2021
7.14.0 Aug 03, 2021
7.14.0a2 Jul 27, 2021
7.14.0a1 Jul 13, 2021
7.13.4 Jul 20, 2021
7.13.3 Jul 07, 2021
7.13.2 Jun 21, 2021
7.13.1 Jun 02, 2021
7.13.0 May 25, 2021
7.12.1 Apr 27, 2021
7.12.0 Mar 23, 2021
7.11.0 Feb 10, 2021
7.11.0b1 Feb 02, 2021
7.10.1 Dec 09, 2020
7.10.0 Nov 11, 2020
7.10.0a2 Oct 20, 2020
7.10.0a1 Oct 14, 2020
7.9.1 Aug 20, 2020
7.9.0 Aug 18, 2020
7.9.0a1 Jul 20, 2020
7.8.1 Jul 30, 2020
7.8.0 Jun 18, 2020
7.8.0a1 May 29, 2020
7.7.1 May 26, 2020
7.7.0 May 13, 2020
7.7.0a2 Apr 03, 2020
7.7.0a1 Apr 01, 2020
7.6.0 Mar 19, 2020
7.6.0a1 Mar 16, 2020
7.5.1 Jan 19, 2020
7.1.0 Nov 14, 2019
7.0.5 Oct 01, 2019
7.0.4 Aug 22, 2019
7.0.3 Aug 21, 2019
7.0.2 May 28, 2019
7.0.1 May 10, 2019
7.0.0 Apr 11, 2019
6.8.2 Mar 09, 2021
6.8.1 Mar 31, 2020
6.8.0 Mar 12, 2020
6.4.0 May 28, 2019
6.3.1 Aug 09, 2018
6.3.0 Jun 20, 2018
6.2.0 Mar 20, 2018
6.1.1 Jan 06, 2018
6.0.0 Nov 14, 2017
5.5.3 Jun 22, 2018
5.5.2 Jan 16, 2018
5.5.1 Nov 10, 2017
5.5.0 Nov 10, 2017
5.4.0 May 18, 2017
5.3.0 Mar 31, 2017
5.2.0 Feb 12, 2017
5.1.0 Jan 11, 2017
5.0.1 Nov 02, 2016
5.0.0 Oct 19, 2016
2.4.1 Jan 03, 2017
2.4.0 Aug 17, 2016
2.3.0 Feb 29, 2016
2.2.0 Jan 05, 2016
2.1.0 Oct 19, 2015
2.0.0 Oct 13, 2015
1.9.0 Oct 19, 2015
1.8.0 Oct 13, 2015
1.7.0 Sep 21, 2015
1.6.0 Jun 10, 2015
1.5.0 May 18, 2015
1.4.0 Feb 11, 2015
1.3.0 Dec 31, 2014
1.2.0 Aug 03, 2014
1.1.1 Jul 04, 2014
1.1.0 Jul 02, 2014
1.0.0 Feb 11, 2014
0.4.5 Feb 11, 2014
0.4.4 Dec 23, 2013
0.4.3 Oct 22, 2013
0.4.2 Oct 08, 2013
0.4.1 Sep 24, 2013

Wheel compatibility matrix

Platform Python 2 Python 3
any

Files in release

Extras: None
Dependencies:
urllib3 (<2.0,>=1.8)