NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1904 most downloaded on PyPI
Python client for Elasticsearch
Last release 1 years ago
16 Apr 2025
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 44 of 45 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
47 releases · first in 2014
This package has been added to the Elasticsearch Python client. Development continues there. Consult the migration documentation for more details.
One column per quarter.
Added support for quantized dense vector options
Autogenerate parts of the library using documentation and types from the Elasticsearch specification
Fixed the use of dictionaries as values in Terms query
Terms query (#1920)Fixed regression introduced in Terms query class
Added support for any iterables to the Terms query
Added support for the semantic_text field and semantic query type
Added the option to use Python types to declare document fields
Document.bulk() (#1864)ConstantKeyword field to the top-level package (#1843)async_connections to the top-level package (#1865)Added text_expansion query clause
text_expansion query clause (#1837)Response.search_after() and Search.search_after() methods for efficient iteration (#1829)iterate() method in the Search class (#1833)Search class (#1771)
Added support for regular expressions in Completion.suggest() (#1836)suggest() method of the Completion class to format requests correctly. (#1836)Document.update() to accept fields set to None or empty (#1820)Added support for knn as a query option
knn as a query option (#1770)dims attribute of the dense vector type optional (#1776)inner_hits option to search.knn() method (#1777)InnerDoc attributes (#1535)_expand__to_dot setting to resolve at runtime (#1633)minimum_should_match values are used (#1774)EmptySearch class (#1780)params option to the FacetedSearch object (#1500)script option for a document update (#1560)keys() and items() methods to AttrDict class (#1784)to_list() method to the AttrList class (#1584)Added support for knn as a query option (#1770)
Made the dims attribute of the dense vector type optional (#1776)
Added missing inner_hits option to search.knn() method (#1777)
Added support for detecting document updates in InnerDoc attributes (#1535)
Changed _expand__to_dot setting to resolve at runtime (#1633)
Added explicit error message when unsupported minimum_should_match values are used (#1774)
Added the EmptySearch class (#1780)
Added params option to the FacetedSearch object (#1500)
Added support for passing a dictionary in the script option for a document update (#1560)
Added keys() and items() methods to AttrDict class (#1784)
Added a to_list() method to the AttrList class (#1584)
Fixed various documentation issues and typos (#1769, #1615, #1585, #1318, #1223)
Added a vector search example (#1778)
Stopped mixing body and parameters in UpdateByQuery
Added Search.rank() method (undocumented as it still is in technical preview)
Search.knn() method (#1691)Search.rank() method (undocumented as it still is in technical preview) (#1692)Added Search.collapse() (#1649, contributed by @qcoumes)
Search.collapse() (#1649, contributed by @qcoumes)Added Elasticsearch 8.x support
MultiTerms aggregation (#1543, contributed by @Telomeraz)CombinedFields query (#1557, contributed by @Telomeraz)Added Elasticsearch 8.x support (#1664)
Dropped support for Python 2.7 and 3.5 (#1606, contributed by @hugovk)
Added support for Python 3.10 and 3.11 (#1608, contributed by @hugovk)
Added the MultiTerms aggregation (#1543, contributed by @Telomeraz)
Added the CombinedFields query (#1557, contributed by @Telomeraz)
Added Elasticsearch 8.x support
MultiTerms aggregation (#1543, contributed by @Telomeraz)CombinedFields query (#1557, contributed by @Telomeraz)Fixed DeprecationWarnings that would be emitted from deprecated usages of the body parameter in the Python Elasticsearch client.
DeprecationWarnings that would be emitted from deprecated usages of the body parameter in the Python Elasticsearch client.Added the ConstantKeyword, RankFeatures field types (#1456, #1465)
ConstantKeyword, RankFeatures field types (#1456, #1465)ScriptScore query type (#1464)UpdateByQueryResponse.success() method (#1463)return_doc_meta parameter to Document.save() and Document.update() for
accessing the complete API response (#1466)calendar_interval and fixed_interval to DateHistogramFacet (#1467)Document.exists() method (#1447, contributed by @dem4ply)year interval to DateHistogramFacet (#1502, contributed by @nrsimha)Added the ConstantKeyword, RankFeatures field types (#1456, #1465)
Added the ScriptScore query type (#1464)
Added UpdateByQueryResponse.success() method (#1463)
Added return_doc_meta parameter to Document.save() and Document.update() for accessing the complete API response (#1466)
Added support for calendar_interval and fixed_interval to DateHistogramFacet (#1467)
Added Document.exists() method (#1447, contributed by @dem4ply)
Added support for the year interval to DateHistogramFacet (#1502, contributed by @nrsimha)
Fixed issue where to_dict() should be called recursively on Search.extras and **kwargs (#1458)
Fixed inverse of an empty Bool query should be MatchNone (#1459)
Fixed issue between retry_on_conflict and optimistic concurrency control within Document.update() (#1461, contributed by @armando1793)
Added Intervals, MatchBoolPrefix, Shape, and Wrapper queries (#1392, #1418)
Intervals, MatchBoolPrefix, Shape, and Wrapper queries (#1392, #1418)Boxplot, RareTerms, VariableWidthHistogram, MedianAbsoluteDeviation,
TTest, CumulativeCardinality, Inference, MovingPercentiles,
and Normalize aggregations (#1416, #1418)__all__ and removed all star imports from elasticsearch_dsl namespace
to avoid leaking unintended names (#1390)Object and Nested could mutate the inner
doc_class mapping (#1255, contributed by @l1nd3r0th)SpanContaining, previously was SpanContainining (#1418)Fixed issue when slicing a Search that would result in a negative size instead of a size of 0. (#1360_, contributed by @bk-equityzen_)
Fixed issue when slicing a Search that would result in a negative size instead of a size of 0. (#1360, contributed by @bk-equityzen)
Added support for geotile_grid aggregation (#1350_, contributed by @owrcasstevens_)
Added support for geotile_grid aggregation (#1350, contributed by @owrcasstevens)
Added the DenseVector and SparseVector data types (#1278)
Added the SearchAsYouType field (#1295, contributed by @dpasqualin)
Fixed name of DoubleRange (#1272, contributed by @braunsonm)
Optimistic concurrent control for Document.delete
Optimistic concurrent control for Document.delete
Removing deprecated DocType
Proper count caching for ES 7.x
Support for multiplexer token filter
Don't substitute for __ in FacetedSearch
Compatibility with Elasticsearch 7.x
Compatibility with Elasticsearch 7.x
Document.save() now returns "created" or "updated"
Dropped support for Python 2.6, 3.2, and 3.3
When using fields the values are no longer merged into the body of the document and have to be accessed via .meta.fields only
Index.document now correctly sets the Document's _index only when using default index
Index.document now correctly sets the Document's _index only when using default index (#1091)
Document inheritance allows overriding Object and Nested field metadata like dynamic
adding auto_date_histogram aggregation
Do not change data in place when (de)serializing
Analyzer.simulate now supports built-in analyzers
Analyzer.simulate now supports built-in analyzers
proper (de)serialization of the Range wrapper
Added search_analyzer to Completion field
Fixed logic around defining a different doc_type name.
Fixed logic around defining a different doc_type name.
Added retry_on_conflict parameter to Document.update.
fields defined on an index are now used to (de)serialize the data even when not defined on a Document
Allow Index.analyzer to construct the analyzer
Detect conflict in analyzer definitions when calling Index.analyzer
Detect conflicting mappings when creating an index
Add simulate method to analyzer object to test the analyzer using the _analyze API.
Add script and script_id options to Document.update
Facet can now use other metric than doc_count
Range objects to help with storing and working with _range fields
Improved behavior of Index.save where it does a better job when index already exists
Composite aggregations now correctly support multiple sources aggs
UpdateByQuery implemented by @emarcey
allow users to redefine doc_type in Index
allow users to redefine doc_type in Index (#929)
include DocType in elasticsearch_dsl module directly (#930)
Backwards incompatible change - DocType refactoring.
Backwards incompatible change - DocType refactoring.
In 6.2.0 we refactored the DocType class and renamed it to Document. The primary motivation for this was the support for types being dropped from elasticsearch itself in 7.x - we needed to somehow link the Index and Document classes. To do this we split the options that were previously defined in the class Meta between it and newly introduced class Index. The split is that all options that were tied to mappings (like setting dynamic = MetaField('strict')) remain in class Meta and all options for index definition (like settings, name, or aliases) got moved to the new class Index.
You can see some examples of the new functionality in the examples directory. Documentation has been updated to reflect the new API.
DocType is now just an alias for Document which will be removed in 7.x. It does, however, work in the new way which is not fully backwards compatible.
Percolator field now expects Query objects as values
you can no longer access meta fields on a Document instance by specifying ._id or similar. Instead all access needs to happen via the .meta attribute.
Implemented NestedFacet for FacetedSearch. This brought a need to slightly change the semantics of Facet.get_values which now expects the whole data dict for the aggregation, not just the buckets. This is a backwards incompatible change for custom aggregations that redefine that method.
Document.update now supports refresh kwarg
DslBase._clone now produces a shallow copy, this means that modifying an existing query can have effects on existing Search objects.
Empty Search no longer defaults to match_all query and instead leaves the query key empty. This is backwards incompatible when using suggest.
Fixed issue with Object/Nested deserialization
Removed String field.
Fixed issue with Object/Nested deserialization
Fixing wheel package for Python 2.7
Fixing wheel package for Python 2.7 (#803)
Backwards incompatible release compatible with elasticsearch 6.0, changes include:
Backwards incompatible release compatible with elasticsearch 6.0, changes include:
use doc as default DocType name, this change includes: * DocType._doc_type.matches method is now used to determine which DocType should be used for a hit instead of just checking _type
Nested and Object field refactoring using newly introduced InnerDoc class. To define a Nested/Object field just define the InnerDoc subclass and then use it when defining the field:
class Comment(InnerDoc): body = Text() created_at = Date() class Blog(DocType): comments = Nested(Comment)methods on connections singleton are now exposed on the connections module directly.
field values are now only deserialized when coming from elasticsearch (via from_es method) and not when assigning values in python (either by direct assignment or in __init__).
fix ip_range aggregation and rename the class to IPRange. Iprange is kept for bw compatibility
Iprange is kept for bw compatibility
fix bug in loading an aggregation with meta data from dict
add support for normalizer parameter of Keyword fields
IndexTemplate can now be specified using the same API as Index
Boolean field now accepts "false" as False
fix constant score query definition
fix constant score query definition
DateHistogramFacet now works with datetime objects
respect __ in field names when creating queries from dict
make sure all response structers are pickleable (for caching)
make sure all response structers are pickleable (for caching)
adding exclude to Search
fix metric aggregation deserialization
expose all index-level APIs on Index class
adding delete to Search which calls delete_by_query API
Renamed Result and ResultMeta to Hit and HitMeta respectively
Renamed Result and ResultMeta to Hit and HitMeta respectively
Response now stores Search which it gets as first arg to __init__
aggregation results are now wrapped in classes and properly deserialized
Date fields now allow for numerical timestamps in the java format (in millis)
Added API documentation
replaced generated classes with manually created
String field type has been deprecated in favor of Text and Keyword
Version compatible with elasticsearch 5.0.
Breaking changes:
String field type has been deprecated in favor of Text and Keyword
fields method has been removed in favor of source filtering
accessing missing string fields no longer returned '' but returns None instead.
None instead.
fix issues with bool's | and & operators and minimum_should_match
+ operator is deprecated, .query() now uses & to combine queries
inner_hits are now also wrapped in Response
+ operator is deprecated, .query() now uses & to combine queries
added mget method to DocType
fixed validation for "empty" values like '' and []
Backwards incompatible changes:
Compatibility with Elasticsearch 2.x:
Filters have been removed and additional queries have been added. Instead of F objects you can now use Q.
Search.filter is now just a shortcut to add queries in filter context
support for pipeline aggregations added
Backwards incompatible changes:
list of analysis objects and classes was removed, any string used as tokenizer, char or token filter or analyzer will be treated as a builtin
internal method Field.to_python has been renamed to deserialize and an optional serialization mechanic for fields has been added.
Custom response class is now set by response_class method instead of a kwarg to Search.execute
Other changes:
FacetedSearch now supports pagination via slicing
Nothing published for this version
Search can now be iterated over to get back hits
Search can now be iterated over to get back hits
Search now caches responses from Elasticsearch
DateHistogramFacet now defaults to returning empty intervals
Search no longer accepts positional parameters
Experimental MultiSearch API
added option to talk to _suggest endpoint (execute_suggest)
FacetedSearch now uses its own Facet class instead of built in aggregations
aggregations
0.0.5 and 0.0.6 was released with broken .tar.gz on pypi, just a build fix
0.0.5 and 0.0.6 was released with broken .tar.gz on pypi, just a build fix
Metadata fields (such as id, parent, index, version etc) must be stored (and retrieved) using the meta attribute (#58) on both Result and DocType obje
retrieved) using the meta attribute (#58) on both Result and DocType objects or using their underscored variants (_id, _parent etc)
query on Search can now be directly assigned
suggest method added to Search
Search.doc_type now accepts DocType subclasses directly
Properties.property method renamed to field for consistency
Date field now raises ValidationException on incorrect data
Nothing published for this version
Added persistence layer (Mapping and DocType), various fixes and improvements.
Added persistence layer (Mapping and DocType), various fixes and improvements.
Fix for python 2
Fix for python 2
Your coding agent can read these notes before it upgrades. Set up the MCP server →