Skip to content
Swiftype Enterprise python client
Branch: master
Clone or download
JasonStoltz Merge pull request #9 from elastic/synchronous-es-calls
Updated Indexing calls to new synchronous API
Latest commit 69b3be4 May 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
swiftype_enterprise Release 0.1.0 May 2, 2019
tests Updated calls to ES to new synchronous API May 2, 2019
.gitignore
.travis.yml
LICENSE Adds rich license Feb 11, 2019
MANIFEST.in V1 Jun 30, 2017
README.md Updated calls to ES to new synchronous API May 2, 2019
logo-enterprise-search.png Adds fancy README Feb 8, 2019
requirements.txt Add requirements.txt Jul 5, 2017
setup.cfg Remove description-file Jun 30, 2017
setup.py
tox.ini V1 Jun 30, 2017

README.md

Elastic Enterprise Search Logo

A first-party Python client for Elastic Enterprise Search.

Contents


Getting started 🐣

Supports Python 2.7 and Python 3.3+.

Depends on futures and requests.

Installed with pip <http://pypi.python.org/pypi/pip>:

$ python -m pip install swiftype_enterprise

You can also download and install the project source:

$ python setup.py install

Usage

Retrieve your access token and a content source key after creating your content source.

Indexing a document into a custom content source:

  from swiftype_enterprise import SwiftypeEnterpriseClient
  from swiftype_enterprise.exceptions import SynchronousDocumentIndexingFailed
  content_source_key = 'content source key'
  authorization_token = 'authorization token'
  client = SwiftypeEnterpriseClient(authorization_token)
  documents = [
    {
      'external_id': '1234',
      'url': 'https://github.com/swiftype/swiftype-enterprise-python',
      'title': 'Swiftype Enterprise Python Github',
      'body': 'A descriptive body, with document contents and metadata'
    }
  ]
  try:
    document_results = client.index_documents(content_source_key, documents, timeout=10, delay=2)
    print(document_results)
  except SynchronousDocumentIndexingFailed:
    # Timed out before documents could finish indexing
    pass

FAQ 🔮

Where do I report issues with the client?

If something is not working as expected, please open an issue.

Contribute 🚀

We welcome contributors to the project. Before you begin, a couple notes...

License 📗

MIT © Elastic

Thank you to all the contributors!

You can’t perform that action at this time.