Skip to main content

sphinx_elasticsearch

Indexes a documentation project build via Sphinx into elasticsearch. This is a stand-alone extraction of the functionality used by readthedocs.org, compatible with elasticsearch-6.

Usage

Set up:

  • Install elasticsearch

  • Install the package: virtualenv --python=python3 .; bin/pip install sphinx_elasticsearch

  • Create index: bin/sphinx-elasticsearch create-index --es-url=http://localhost:9200 --replicas=1 --shards=5 bin/sphinx-elasticsearch put-mapping --es-url=http://localhost:9200

By default we use an index named docs and a document type page, you can customize this via the --index and --type parameters (but you’ll need to pass them to all three commands, create-index, put-mapping and index).

Note that you’ll probably be better off managing index creation and mapping setup yourself; these two setup commands are more for getting started quickly and out of the box.

Index your sphinx project:

  • Build your project as JSON (for easier parsing): bin/sphinx-build -b json . json-build

  • Index into ES: bin/sphinx-elasticsearch index --es-url=http://localhost:9200 --index=docs json-build (If you pass --commit any previously indexed pages that have been deleted will be removed automatically.)

Elasticsearch Mapping

project:

Short name of the project. Clients will use this to construct URLs.

path:

Relative path of the page, without extension.

id:

Unique identifier (hash of project and path)

commit:

Optional, to allow deleting deleted pages on subsequent index runs.

title:

Title of the page

headers:

List of all headers on the page

content:

Body of the page (any HTML markup is stripped by ES)

sphinx_elasticsearch changes

1.0.1 (2018-12-11)

  • Flush after indexing and before deleting, to prevent conflict errors

1.0.0 (2018-12-09)

  • Initial release

Metadata

Release files for sphinx-elasticsearch 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-elasticsearch 1.0.1
File Size Uploaded Provenance Actions
sphinx_elasticsearch-1.0.1.tar.gz 9.5 kB Without provenance Details for sphinx_elasticsearch-1.0.1.tar.gz

Release files / sphinx_elasticsearch-1.0.1.tar.gz

Download URL sphinx_elasticsearch-1.0.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a4143838a99b1e9109412c6c7c154adb7e57ea5ebe4010e77f0dd667a43a5562
BLAKE2b-256 checksum
How to use checksums
a57a0a2504071b8aa4b24ac114083dc259719a40951e2a4f7fa7ec5c51a8a7d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.8

Security for sphinx-elasticsearch 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page