elasticsearch_tool
介绍
python es的辅助工具,提供类似ORM的操作方式
主要借鉴SQLAlchemy的方式
使用说明
目前项目处于测试阶段,由于不同版本的Python/elasticsearch的接口不同,存在一些差异,目前该项目依赖于Python/elasticsearch5.0.0, 已知最新版本的Python/elasticsearch会出错,主要是接口参数错误 该问题会在后期进行解决,
测试环境为: Python3.6 elasticsearch-5.6.0 elasticsearch-analysis-ik-5.6.0
安装
pip3 install elasticsearch_tool
简单使用
"""
搜索测试工具,数据填充脚本
"""
import random, time
from elasticsearch_tool import Doc, Fields, NOT, OR
from datetime import datetime
from elasticsearch_tool.config import Config
# 配置es服务器地址信息
Config.set_host('localhost', port='9200')
words = ['单词', '词汇', '检索', '我了', '艾克', '维护费', '没理解', '接是', '咯怕', '那么', '行风', '奶茶店', '全网通', '