DSL,Elasticsearch,Elasticsearch DSL

所谓领域专用语言(domain specific language / DSL),其基本思想是“求专不求全”,不像通用目的语言那样目标范围涵盖一切软件问题,而是专门针对某一特定问题的计算机语言。几乎自计算机发明伊始,人们就开始谈论DSL使用DSL了

Python Elasticsearch Client

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. 官方底层Elasticsearch的client.它的目标是给所有的在python中的Elasticsearch相关的代码提供一致的方法(common ground);因为这点它试着保持观点非常开放以及高度可扩展。

For a more high level client library with more limited scope, have a look at elasticsearch-dsl - it is a more pythonic library sitting on top of elasticsearch-py. 想要更高层的client库(但有更多限制),请看 elasticsearch-dsl(下面),它是一个建立在elasticsearch-py基础之上的更python风格的库。

Elasticsearch DSL

elasticsearch-dsl:灵活的 Elasticsearch Python ORM(关系对象映射)

Elasticsearch DSL is a high-level library whose aim is to help with writing and running queries against Elasticsearch. It is built on top of the official low-level client (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. It exposes the whole range of the DSL from Python either directly using defined classes or a queryset-like expressions.

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