https://github.com/panodata/sphinx-sql-backend
SQL backend for the Sphinx documentation generator. The focus is fulltext search (FTS), but there may be more. [WIP]
https://github.com/panodata/sphinx-sql-backend
bm25 cratedb fts lucene sphinx-doc sphinx-extension sphinx-fts sphinx-search
Last synced: about 2 months ago
JSON representation
SQL backend for the Sphinx documentation generator. The focus is fulltext search (FTS), but there may be more. [WIP]
- Host: GitHub
- URL: https://github.com/panodata/sphinx-sql-backend
- Owner: panodata
- License: apache-2.0
- Created: 2024-01-28T15:19:14.000Z (over 1 year ago)
- Default Branch: postgresql
- Last Pushed: 2024-01-29T04:14:37.000Z (over 1 year ago)
- Last Synced: 2025-01-28T12:19:31.051Z (4 months ago)
- Topics: bm25, cratedb, fts, lucene, sphinx-doc, sphinx-extension, sphinx-fts, sphinx-search
- Language: Python
- Homepage:
- Size: 82 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
==================
sphinx-sql-backend
==================SQL backend for the Sphinx documentation generator.
.. image:: https://img.shields.io/pypi/v/sphinx-sql-backend.svg
:target: https://pypi.org/project/sphinx-sql-backend/.. image:: https://github.com/panodata/sphinx-sql-backend/actions/workflows/main.yml/badge.svg?branch=main
:alt: Run CI
:target: https://github.com/panodata/sphinx-sql-backend/actions/workflows/main.yml.. image:: https://readthedocs.org/projects/sphinx-sql-backend/badge/?version=latest
:target: https://sphinx-sql-backend.readthedocs.io/en/latest/?badge=latest
:alt: Documentation StatusWhat's inside
=============A Sphinx extension to provide Full-Text-Search (FTS) based on SQL
databases.The package is completely based on `atsphinx-sqlite3fts`_ by
`Kazuya Takei`_, so many kudos and thanks go out to him.
See also `sqlite3fts on GitHub`_.Status
======Please note that the ``sphinx-sql-backend`` package contains alpha-, beta- and
incubation-quality code, and as such, is considered to be a work in progress.
Contributions of all kinds are much welcome, in order to make it more solid,
and to add features.Breaking changes should be expected until a 1.0 release, so version pinning is
strongly recommended, especially when you use it as a library.How it works
============* Indexing: When running ``sphinx-build``, store documents into database.
* Searching: Provide backend service for responding to search requests and
search-as-you-type UI based on `readthedocs-sphinx-search`_.Installation
============.. code-block:: console
pip install git+https://github.com/panodata/sphinx-sql-backend.git
Usage
=====1. Register extension into your ``conf.py`` and configure it.
.. code-block:: python
extensions = [
#
# Other extensions
#
"atsphinx.sqlite3fts", # Add it
]2. Run builder (html-based builder only).
.. code-block:: console
sphinx-build -M html source build
3. To try it in local, use ``http.server`` module.
.. code-block:: console
python -m http.server -d _build/html
Please access http://localhost:8000/search.html
Development
===========Install package in development mode::
pip install --editable='.[cli,docs,test]' --prefer-binary
Start PostgreSQL server::
docker run --rm -it --publish=5432:5432 --env "POSTGRES_HOST_AUTH_METHOD=trust" postgres:16 postgres -c log_statement=all
Invoke software tests::
export POSTGRES_LOG_STATEMENT=all
pytest -vvvInvoke linters::
pip install pre-commit
pre-commit run --all-files.. _atsphinx-sqlite3fts: https://pypi.org/project/atsphinx-sqlite3fts/
.. _Kazuya Takei: https://github.com/attakei
.. _readthedocs-sphinx-search: https://github.com/readthedocs/readthedocs-sphinx-search
.. _sqlite3fts on GitHub: https://github.com/atsphinx/sqlite3fts