Skip to main content
  • RSS
Table of contents
  • Notes on Sphinx’s built-in search
    • Disable search summary
    • Speeding up index generation
    • Customize the search scorer
    • OpenSearch?
    • Remove a page from search results
    • References

Notes on Sphinx’s built-in search§

WIP

Disable search summary§

Maybe this? Didn’t work via Chrome DevTools Console.

DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY = false;

Speeding up index generation§

Install PyStemmer: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_search_language

Customize the search scorer§

Set this config flag: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_search_scorer

And then implement the custom scorer in a JS file.

OpenSearch?§

Not sure what this does: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_use_opensearch

Remove a page from search results§

Just add :nosearch: to top of page. https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html

Thanks to Documatt for making me aware of that feature

References§

Backend (search index) implementation:

  • //sphinx/search/__init__.py

  • //sphinx/search/_stopwords/en.txt

  • //sphinx/search/_stopwords/en.py

  • //sphinx/search/en.py

  • //sphinx/search/non-minified-js/base-stemmer.js

  • //sphinx/search/non-minified-js/english-stemmer.js

Frontend (search UI) implementation:

  • //sphinx/themes/basic/search.html

  • //sphinx/themes/basic/searchbox.html

  • //sphinx/themes/basic/searchfield.html

  • //sphinx/themes/basic/static/searchtools.js

  • //sphinx/themes/basic/static/sphinx_highlight.js

  • What is Sphinx built-in search, and how to use it in themes?

© 2025 Kayce Basques

Source code

Proud member of the tech writing webring | Previous | Next | Random