用于elasticsearch的非官方python客户端

predikto-elasticsearch的Python项目详细描述


用于ElasticSearch的非官方低级客户端。它的目标是在官方弹性搜索py的基础上稍加扩展 库,同时在过渡期间提供更频繁的发布。具体来说,我们正在使用elasticsearch 2.x, 1.x不受支持,5.x可能是事后考虑。为了支持这两种方案中的任何一种,请转到主回购协议

相容性

在使用fork时,最新版本的elasticsearch 2.x版本是2.4.0,因此
预测弹性搜索Py将为2.4.1。

安装

使用pip:

安装elasticsearch
pip install predikto-elasticsearch

示例使用

简单用例:

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

功能

客户的功能包括:

  • 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

许可证

2015 ElasticSearch版权所有

根据apache许可证2.0版(以下简称“许可证”)授权; 除非符合许可证,否则您不能使用此文件。 你可以在

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

除非适用法律要求或书面同意,否则软件 根据许可证分发是按“原样”分发的, 无任何明示或默示的保证或条件。 有关管理权限的特定语言和 许可下的限制

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如果BigInteger对于int太大,如何返回int?   JavaSOAP处理程序组织。w3c。多姆。DOMEException:层次结构\u请求\u错误:   java是“public Boolean isBikeTyreFlat()”有效的JavaBeans方法签名吗?   java如何在eclipse中导入hql项目   在Java中检查字符串数组中所有字符串的长度是否相等   hex java如何在指定的值范围内生成随机十六进制值   Trycatchfinally中的java死锁   java libGDX阶段输入处理   如果服务器超时,javasocketInputStream read()是否会解除阻止?   java提高JAXRS应用程序的性能   wikitude库在安卓上生成AR的java问题   LotusNotesJavaUIEclipse插件   java Jackson不反序列化Kotlin数据类中的列表字段   java Spring数据排序操作超出最大大小   java Apache Camel RouteBuilder配置方法   从Postgres数据库检索时,字节数组的java大小增加了一倍   java无法启动组件[StandardEngine[Catalina]。标准主机[本地主机]。标准上下文[/JDBC_DBO]]   Java中的二维列表   java如何在postgres中为%type创建IN,OUT,我试过这个   JAVAlang.ClassNotFoundException:org。阿帕奇。德比。jdbc。嵌入式驱动程序(包括JAR)