Changelog
8.18.0 (2025-04-16)
This package has been added to the Elasticsearch Python client. Development continues there. Consult the migration documentation for more details. (#1972)
8.17.1 (2025-01-08)
8.17.0 (2024-12-13)
8.16.0 (2024-11-13)
8.15.4 (2024-10-07)
Fixed the use of dictionaries as values in
Termsquery (#1920)
8.15.3 (2024-09-12)
8.15.2 (2024-09-04)
8.15.1 (2024-08-19)
8.15.0 (2024-08-09)
Added the option to use Python types to declare document fields (#1845)
Added type annotations (#1533)
Added support for bulk document operations with
Document.bulk()(#1864)Added the
ConstantKeywordfield to the top-level package (#1843)Added
async_connectionsto the top-level package (#1865)Added index creation to the aggregations example (#1862)
8.14.0 (2024-06-10)
Added
text_expansionquery clause (#1837)Added
Response.search_after()andSearch.search_after()methods for efficient iteration (#1829)Added point in time support and the
iterate()method in theSearchclass (#1833)Added support for slicing multiple times in
Searchclass (#1771) Added support for regular expressions inCompletion.suggest()(#1836)Fixed
suggest()method of theCompletionclass to format requests correctly. (#1836)Fixed
Document.update()to accept fields set toNoneor empty (#1820)
8.13.1 (2024-04-30)
Added support for
knnas a query option (#1770)Made the
dimsattribute of the dense vector type optional (#1776)Added missing
inner_hitsoption tosearch.knn()method (#1777)Added support for detecting document updates in
InnerDocattributes (#1535)Changed
_expand__to_dotsetting to resolve at runtime (#1633)Added explicit error message when unsupported
minimum_should_matchvalues are used (#1774)Added the
EmptySearchclass (#1780)Added
paramsoption to theFacetedSearchobject (#1500)Added support for passing a dictionary in the
scriptoption for a document update (#1560)Added
keys()anditems()methods toAttrDictclass (#1784)Added a
to_list()method to theAttrListclass (#1584)Fixed various documentation issues and typos (#1769, #1615, #1585, #1318, #1223)
Added a vector search example (#1778)
8.13.0 (2024-04-03)
8.12.0 (2024-01-18)
8.11.0 (2023-11-13)
8.9.0 (2023-09-07)
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
MultiTermsaggregation (#1543, contributed by @Telomeraz)Added the
CombinedFieldsquery (#1557, contributed by @Telomeraz)
7.4.1 (2023-03-01)
Fixed
DeprecationWarningsthat would be emitted from deprecated usages of thebodyparameter in the Python Elasticsearch client.
7.4.0 (2021-07-15)
Added the
ConstantKeyword,RankFeaturesfield types (#1456, #1465)Added the
ScriptScorequery type (#1464)Added
UpdateByQueryResponse.success()method (#1463)Added
return_doc_metaparameter toDocument.save()andDocument.update()for accessing the complete API response (#1466)Added support for
calendar_intervalandfixed_intervaltoDateHistogramFacet(#1467)Added
Document.exists()method (#1447, contributed by @dem4ply)Added support for the
yearinterval toDateHistogramFacet(#1502, contributed by @nrsimha)Fixed issue where
to_dict()should be called recursively onSearch.extrasand**kwargs(#1458)Fixed inverse of an empty
Boolquery should beMatchNone(#1459)Fixed issue between
retry_on_conflictand optimistic concurrency control withinDocument.update()(#1461, contributed by @armando1793)
7.3.0 (2020-09-16)
Added
Intervals,MatchBoolPrefix,Shape, andWrapperqueries (#1392, #1418)Added
Boxplot,RareTerms,VariableWidthHistogram,MedianAbsoluteDeviation,TTest,CumulativeCardinality,Inference,MovingPercentiles, andNormalizeaggregations (#1416, #1418)Added
__all__and removed all star imports fromelasticsearch_dslnamespace to avoid leaking unintended names (#1390)Fixed an issue where
ObjectandNestedcould mutate the innerdoc_classmapping (#1255, contributed by @l1nd3r0th)Fixed a typo in query
SpanContaining, previously wasSpanContainining(#1418)
7.2.1 (2020-06-02)
Fixed issue when slicing a Search that would result in a negative
sizeinstead of asizeof 0. (#1360, contributed by @bk-equityzen)
7.2.0 (2020-05-04)
Added support for
geotile_gridaggregation (#1350, contributed by @owrcasstevens)Added the
DenseVectorandSparseVectordata types (#1278)Added the
SearchAsYouTypefield (#1295, contributed by @dpasqualin)Fixed name of
DoubleRange(#1272, contributed by @braunsonm)
7.1.0 (2019-10-23)
Optimistic concurrent control for Document.delete
Removing deprecated
DocTypeProper count caching for ES 7.x
Support for
multiplexertoken filterDon’t substitute for
__inFacetedSearch
7.0.0 (2019-04-26)
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
fieldsthe values are no longer merged into the body of the document and have to be accessed via.meta.fieldsonly
6.4.0 (2019-04-26)
Index.documentnow correctly sets theDocument’s_indexonly when using default index (#1091)Documentinheritance allows overridingObjectandNestedfield metadata likedynamicadding
auto_date_histogramaggregationDo not change data in place when (de)serializing
6.3.1 (2018-12-05)
Analyzer.simulatenow supports built-in analyzersproper (de)serialization of the
RangewrapperAdded
search_analyzertoCompletionfield
6.3.0 (2018-11-21)
Fixed logic around defining a different
doc_typename.Added
retry_on_conflictparameter toDocument.update.fields defined on an index are now used to (de)serialize the data even when not defined on a
DocumentAllow
Index.analyzerto construct the analyzerDetect conflict in analyzer definitions when calling
Index.analyzerDetect conflicting mappings when creating an index
Add
simulatemethod toanalyzerobject to test the analyzer using the_analyzeAPI.Add
scriptandscript_idoptions toDocument.updateFacetcan now use other metric thandoc_countRangeobjects to help with storing and working with_rangefieldsImproved behavior of
Index.savewhere it does a better job when index already existsComposite aggregations now correctly support multiple
sourcesaggsUpdateByQueryimplemented by @emarcey
6.2.1 (2018-07-03)
allow users to redefine
doc_typeinIndex(#929)include
DocTypeinelasticsearch_dslmodule directly (#930)
6.2.0 (2018-07-03)
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.
Percolatorfield now expectsQueryobjects as valuesyou can no longer access meta fields on a
Documentinstance by specifying._idor similar. Instead all access needs to happen via the.metaattribute.Implemented
NestedFacetforFacetedSearch. This brought a need to slightly change the semantics ofFacet.get_valueswhich now expects the whole data dict for the aggregation, not just thebuckets. This is a backwards incompatible change for custom aggregations that redefine that method.Document.updatenow supportsrefreshkwargDslBase._clonenow produces a shallow copy, this means that modifying an existing query can have effects on existingSearchobjects.Empty
Searchno longer defaults tomatch_allquery and instead leaves thequerykey empty. This is backwards incompatible when usingsuggest.
6.1.0 (2018-01-09)
Removed
Stringfield.Fixed issue with
Object/Nesteddeserialization
6.0.1 (2018-01-02)
Fixing wheel package for Python 2.7 (#803)
6.0.0 (2018-01-01)
Backwards incompatible release compatible with elasticsearch 6.0, changes include:
use
docas defaultDocTypename, this change includes: *DocType._doc_type.matchesmethod is now used to determine whichDocTypeshould be used for a hit instead of just checking_type
NestedandObjectfield refactoring using newly introducedInnerDocclass. To define aNested/Objectfield just define theInnerDocsubclass and then use it when defining the field:class Comment(InnerDoc): body = Text() created_at = Date() class Blog(DocType): comments = Nested(Comment)methods on
connectionssingleton are now exposed on theconnectionsmodule directly.field values are now only deserialized when coming from elasticsearch (via
from_esmethod) and not when assigning values in python (either by direct assignment or in__init__).
5.4.0 (2017-12-06)
fix
ip_rangeaggregation and rename the class toIPRange.Iprangeis kept for bw compatibilityfix bug in loading an aggregation with meta data from dict
add support for
normalizerparameter ofKeywordfields
IndexTemplatecan now be specified using the same API asIndex
Booleanfield now accepts"false"asFalse
5.3.0 (2017-05-18)
fix constant score query definition
DateHistogramFacetnow works withdatetimeobjectsrespect
__in field names when creating queries from dict
5.2.0 (2017-03-26)
make sure all response structers are pickleable (for caching)
adding
excludetoSearchfix metric aggregation deserialization
expose all index-level APIs on
Indexclassadding
deletetoSearchwhich callsdelete_by_queryAPI
5.1.0 (2017-01-08)
Renamed
ResultandResultMetatoHitandHitMetarespectively
Responsenow storesSearchwhich it gets as first arg to__init__aggregation results are now wrapped in classes and properly deserialized
Datefields now allow for numerical timestamps in the java format (in millis)Added API documentation
replaced generated classes with manually created
5.0.0 (2016-11-04)
Version compatible with elasticsearch 5.0.
Breaking changes:
Stringfield type has been deprecated in favor ofTextandKeyword
fieldsmethod has been removed in favor ofsourcefiltering
2.2.0 (2016-11-04)
accessing missing string fields no longer returned
''but returnsNoneinstead.fix issues with bool’s
|and&operators andminimum_should_match
2.1.0 (2016-06-29)
inner_hitsare now also wrapped inResponse
+operator is deprecated,.query()now uses&to combine queriesadded
mgetmethod toDocTypefixed validation for “empty” values like
''and[]
2.0.0 (2016-02-18)
Compatibility with Elasticsearch 2.x:
Filters have been removed and additional queries have been added. Instead of
Fobjects you can now useQ.
Search.filteris now just a shortcut to add queries in filter contextsupport 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_pythonhas been renamed todeserializeand an optional serialization mechanic for fields has been added.Custom response class is now set by
response_classmethod instead of a kwarg toSearch.execute
Other changes:
FacetedSearchnow supports pagination via slicing
0.0.10 (2016-01-24)
Searchcan now be iterated over to get back hits
Searchnow caches responses from Elasticsearch
DateHistogramFacetnow defaults to returning empty intervals
Searchno longer accepts positional parametersExperimental
MultiSearchAPIadded option to talk to
_suggestendpoint (execute_suggest)
0.0.9 (2015-10-26)
FacetedSearchnow uses its ownFacetclass instead of built in aggregations
0.0.8 (2015-08-28)
0.0.5and0.0.6was released with broken .tar.gz on pypi, just a build fix
0.0.5 (2015-08-27)
added support for (index/search)_analyzer via #143, thanks @wkiser!
even keys accessed via
['field']onAttrDictwill be wrapped inAttr[Dict|List]for consistencyAdded a convenient option to specify a custom
doc_classto wrap inner/Nested documents
blankoption has been removed
AttributeErroris no longer raised when accessing an empty field.added
requiredflag to fields and validation hooks to fields and (sub)documentsremoved
getmethod fromAttrDict. Usegetattr(d, key, default)instead.added
FacetedSearchfor easy declarative faceted navigation
0.0.4 (2015-04-24)
Metadata fields (such as id, parent, index, version etc) must be stored (and retrieved) using the
metaattribute (#58) on bothResultandDocTypeobjects or using their underscored variants (_id,_parentetc)query on Search can now be directly assigned
suggestmethod added toSearch
Search.doc_typenow acceptsDocTypesubclasses directly
Properties.propertymethod renamed tofieldfor consistencyDate field now raises
ValidationExceptionon incorrect data
0.0.3 (2015-01-23)
Added persistence layer (Mapping and DocType), various fixes and
improvements.
0.0.2 (2014-08-27)
Fix for python 2
0.0.1 (2014-08-27)
Initial release.