Search functionality broken with Sphinx >= 6.0.0
maxtepkeev opened this issue · 5 comments
Sphinx >= 6.0.0 dropped support for jQuery and underscore.js, I've tried both of the proposed solutions and none of them worked, i.e. there's no errors or anything in the console, it's just that search doesn't find anything. Reverting back to Sphinx 5.3.0 fixes the problem and search works again
Well that's unfortunate. I haven't seen this myself because for reasons I can't quite figure out, pip never wants to give me a Sphinx >4.3.2, even though my dev env is Python 3.6 and RTD is 3.7 and Sphinx supports both of those at least up until 5.3 or so.
I note Sphinx 6 requires Python 3.8, so attempts to repro this need at least that Python version.
This repo will be migrating to the Sphinx org in the near future so I'm hoping one of the devs responsible for the change you mentioned will have an idea for how to address this. (maybe paging @AA-Turner ?)
@maxtepkeev do you have a minimal reproducing example at all, please?
A
Hi @AA-Turner
Apologies, I should have been more precise in the description, the thing is I'm using sphinx-build -b html -n -W --keep-going -j auto . _build
and it seems that this is where the problem I'm experiencing comes from, because when I just use make html
search functionality works fine with both Sphinx 5.3.0 and 6.1.3 (together with sphinxcontrib-jquery), while when using the command above I have no problems with Sphinx 5.3.0 and non-working search with 6.1.3 (together with sphinxcontrib-jquery).
As for the reproducing example (both generated with sphinx-build -b html -n -W --keep-going -j auto . _build
):
- https://python-redmine.com/search.html?q=issue - this is Sphinx 5.3.0 and no problems with search.
- https://python-redmine.com/broken/search.html?q=issue - this is Sphinx 6.1.3 and sphinxcontrib-jquery 4.1 with non-working search, but no signs of jquery or any other errors in the console.
Hope that helps. Thanks.
@maxtepkeev -- if you check searchindex.js
, the non-broken one is ~10x larger. Searching for e.g. 'need' does yield results. I believe that alabaster is in the clear here, and that the problem is the search index in some way -- please would you be able to open a Sphinx issue with a minimal reproducer showing an example where the search index is different between the two versions?
I'll close this issue for now, please re-open if you disagree with my assessment.
A
@AA-Turner You were right, it's the searchindex.js
that was broken and it was fixed in Sphinx 6.2.0 by sphinx-doc/sphinx#11192. I've tested everything with both 6.2.0 and 7.0.1 (which is the latest released Sphinx version as of now) and can confirm that the problem is gone and everything works as expected.