swiftype enterprise的api客户端
swiftype-enterprise的Python项目详细描述
A first-party Python client for Elastic Enterprise Search.
内容
入门
支持Python2.7和Python3.3+。
与一起安装
pip <http://pypi.python.org/pypi/pip>
:
$ python -m pip install swiftype_enterprise
您还可以下载并安装项目源代码:
$ python setup.py install
用法
创建内容源后检索访问令牌和内容源密钥。
将文档索引为自定义内容源:
fromswiftype_enterpriseimportSwiftypeEnterpriseClientcontent_source_key='content source key'authorization_token='authorization token'client=SwiftypeEnterpriseClient(authorization_token)documents=[{'id':'1234','url':'https://github.com/swiftype/swiftype-enterprise-python','title':'Swiftype Enterprise Python Github','body':'A descriptive body, with document contents and metadata'}]document_results=client.index_documents(content_source_key,documents,timeout=10,delay=2)print(document_results)
更改API端点
client=SwiftypeEnterpriseClient(authorization_token,"https://your-server.example.com/api/v1/ent")
常见问题解答
我应该在哪里向客户报告问题?
如果某些东西没有按预期工作,请打开issue。
贡献
我们欢迎项目的贡献者。在开始之前,请注意…
- 在打开拉取请求之前,请创建一个到discuss the scope of your proposal的问题。
- 请在适当的时候编写简单的代码和简明的文档。
许可证
感谢所有的contributors!