跳转到主要内容

Swiftype Enterprise搜索的弃用API客户端。请使用elastic_enterprise_search代替。

项目描述

Elastic Enterprise Search Logo

⚠️ 此客户端已弃用 ⚠️

swiftype_enterprise 已被 elastic_enterprise_search 替代。谢谢! - Elastic

Elastic Enterprise Search的官方Python客户端。

内容


入门 🐣

支持Python 2.7和Python 3.3+。

依赖于futuresrequests

使用pip <http://pypi.python.org/pypi/pip>安装

$ python -m pip install swiftype_enterprise

您还可以下载并安装项目源代码

$ python setup.py install

用法

创建内容源后,检索您的访问令牌和内容源密钥。

将文档索引到自定义内容源

  from swiftype_enterprise import SwiftypeEnterpriseClient
  content_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")

常见问题解答 🔮

我在哪里报告客户端的问题?

如果某些功能未按预期工作,请打开问题

贡献 🚀

我们欢迎对项目做出贡献。在您开始之前,请注意以下几点...

  • 在打开拉取请求之前,请创建一个问题来讨论您提案的范围
  • 在适当的情况下,请编写简洁的代码和文档。

许可证 📗

MIT © Elastic

感谢所有贡献者

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

swiftype_enterprise-1.0.1.tar.gz (4.9 kB 查看哈希)

上传时间

由支持