-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Issue with search across subprojects #12162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I missed this issue before when searching for "search" related things which is probably relevant if the theme is circumventing the search addon (which is active on the dashboard for all projects): pydata/pydata-sphinx-theme#1933 |
Hi, currently, you have to manually check the "include subprojects" box in We have plans to make it more configurable, so for example that check to always be checked. We have an open issue at readthedocs/addons#22. |
For full context, when I posted the issue there was a single search bar, the theme one which I was unable to get to work with the readthedocs search (and still am, it is the lower bar now; I also commented on the theme issue related to this). As other themes do integrate with readthedocs I copied a search bar from these themes as the top bar and used the javascript from https://docs.readthedocs.com/platform/stable/addons.html#integrate-with-search-as-you-type:
I was able to adapt it to the top bar but not to the lower one no matter which selectors I tried, hence the theme incompatibility I mention as the theme also has search related javascript which probably interferes (I have no idea about javascript). Having the include subprojects check on by default will be nice, but the issue was about the flyout appearing at all which does never appear when using the pydata-sphinx-them even if using this javascript above with what to my non-javscript self looks like the right selector (same as default one |
looks like you are including the script before the DOM loads, the script needs to run after the DOM is loaded for it to find the node. You can achieve this in several ways, an easy one would be to add the |
Details
I am not sure when it started to happen, but we have a main project with multiple subprojects and results from subprojects have stopped appearing when searching on the main project.
Expected Result
Several months back whenever searching we would get search results across subprojects as expected from the docs and search entries got indicators (from "docs" project) or (from "examples" project).
Actual Result
Currently search is only local to pymcio project which has a landing page and a blogpost so it generally finds nothing and there are no longer any (from "xyz" project) indicators because nothing from any subproject is found even when there should be matches.
I am not sure what is happening nor at what level the issue might be, something general, theme specific, maybe we are breaking things when customizing the theme further. I leave some extra details below and sorry if I am not reporting to the right place.
Extra details
As users are generally not very aware of the subproject they are in and expected search to be "global" we aliased the search of the subprojects to that of the main project. But back when we did that it wasn't an issue, it still worked.
Right now I am attempting to have two search bars on the search page (see example https://pymcio--225.org.readthedocs.build/projects/bart/en/225/search.html) which so far seems to redirect the searches to the right place, but the search from the parent project is local instead of global across subprojects (as it is a redirect from the PR preview to the published parent project search).
We weren't so far but we will be templating the
search.html
page and extending one of its blocks to add the extra search bar. We were templating thecomponents/search-filed.html
and will continue to do so. We are using the pydata-sphinx-theme which itself also templates thesearch.html
and as fas as I can tell has been doing so from before we started using, so global search worked initially with that setup. Link to custom theme project (only a handful of changes on top of pydata-sphinx-one): https://github.com/pymc-devs/pymc-sphinx-themeThe text was updated successfully, but these errors were encountered: