sphinx
sphinx copied to clipboard
HTML Search: Contains duplicates based on title and content search
Describe the bug
We currently list the same page multiple times if, for example, both the title and content search match it. Since the preview is always the same, this is not very helpful.
How to Reproduce
An easy way to reproduce the bug is to do a title search: the first result will link to the section, the second will link to the page in general. It appears that the "remove duplicates" feature was added some time ago, perhaps before there were multiple ways in which documents were searched.
https://pradyunsg.me/furo/search/?q=quickstart&check_keywords=yes&area=default
Note that it appears the main sphinx documentation uses readthedocs' custom search, so this bug wouldn't be reproducible there.
Environment Information
Sphinx main as of 2024-02-06: https://github.com/sphinx-doc/sphinx/commit/e976059fd6ab49b1c2784445d7095c9287897724
Sphinx extensions
No response
Additional context
No response