Indexes documentation build via Sphinx into elasticsearch
Project description
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.0 (2018-12-09)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for sphinx_elasticsearch-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd236a346ccd3231aa543e2066b91aeb841bd44ed65f06d392f7b47f493757b9 |
|
MD5 | caa5947fd6c5eca29107ea2fadb8957c |
|
BLAKE2b-256 | 4173f724de440b714601b2e2c300f3e1ce07084f06437c3abc70ae0f621582e5 |