We use RTD to produce the documentation for our project. The documentation consists of two broad parts: book-style chapters & sections on the one hand, and auto-generated documentation extracted from the code on the other.
We find that often one wants to search only one of the two, but not both at the same time. Is there a way to set this up, or a clever use of an existing mechanism that would do this? A kind of keyword or specifier in the search box would be ideal.
For reference: the full documentation and the auto-generated part.
currently this isn't possible, but we are taking it into consideration https://github.com/readthedocs/readthedocs.org/issues/5966.
In the meantime, Steve's solution How can I restrict search results to certain sections of an RTD manual? is a great workaround. They are using a patched version of Sphinx's searchtools.js https://github.com/plone/documentation/blob/7dc58219ee75129831a481f24849defcd8b290bd/docs/_static/searchtools.js#L225-L231.
Another solution, similar to the above, can be achieved using our API https://docs.readthedocs.io/en/stable/server-side-search.html#get--api-v2-search- and filtering the results client side (this is using the path
attribute of each result)