Skip to content

Config: Add explicit options to exclude a project from search #10092

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

Closed
benjaoming opened this issue Mar 1, 2023 · 4 comments
Closed

Config: Add explicit options to exclude a project from search #10092

benjaoming opened this issue Mar 1, 2023 · 4 comments
Labels
Feature New feature Improvement Minor improvement to code Needed: design decision A core team decision is required

Comments

@benjaoming
Copy link
Contributor

benjaoming commented Mar 1, 2023

Some documentation projects want to have their own search in place of server side search. This means that none of the search features should be active on the project. Some projects can want a mix of this.

This might be a bit complicated, but there are several cases to cover for:

  • a) Project wants to disable in-doc searching (but keep the project indexed so it appears in Dashboard searches and global searches)
  • b) Project wants to exclude itself from dashboard searches (but keep in-doc search and global search)
  • c) Project wants to exclude itself from global searches (but keep in-doc search and dashboard search) (only valid for community projects)
  • d) Project wants to disable in-doc search and excluded from global search and dashboard search

Only d) would benefit from disabling indexing, but it's not necessary given that there are explicit options for in-doc, dashboard and global search inclusion.

Currently, we can remove all pages from search indexing: search.ignore: all is perhaps better than search.ignore: '*'.. but it doesn't really matter, since this does not work for a), b) nor c).

Here's a rough sketch of how that could look:

search:
   include: # unchanged
   exclude: all # new option 'all' in place of '*'
   scopes:
       indoc: disable  # default: enable. The meaning of 'disable' is also to remove extensions to the documentation tool, Sphinx or MkDocs.
       global: disable  # default: enable
       dashboard: disable  # default: enable
@benjaoming benjaoming added Improvement Minor improvement to code Feature New feature Needed: design decision A core team decision is required labels Mar 1, 2023
@benjaoming benjaoming changed the title Add explicit options to exclude a project from search Config: Add explicit options to exclude a project from search Mar 1, 2023
@benjaoming
Copy link
Contributor Author

(this issue is added to summarize how a potential less-hackish solution to a support issue could be fixed)

@stsewd
Copy link
Member

stsewd commented Mar 1, 2023

a) Project wants to disable in-doc searching (but keep the project indexed so it appears in Dashboard searches and global searches)

We have a feature flag for this, and this is only relevant for sphinx projects, we inject our custom search there by default. For mkdocs and docs built with build.commands, we don't inject our custom search, users need to do that themselves (this can be by installing our sphinx search extension).

b) Project wants to exclude itself from dashboard searches (but keep in-doc search and global search)

Not sure if I understand this one, is this "dashboard search" https://readthedocs.org/search/?q=project:docs%20 you are referring to?

@benjaoming
Copy link
Contributor Author

I've been confused since I received that question about disabling server side search on MkDocs. I get now that it doesn't exist and you've done tonnes of work to plan it for MkDocs 👍

We have a feature flag for this, and this is only relevant for sphinx projects

I hope it will be relevant to have configuration for this. IIRC, we want to stop using feature flags for configuration.

Not sure if I understand this one, is this "dashboard search"

Maybe there's another term? Dashboard search is searches performed by the user while logged in on their own projects or projects that they have special access to on Read the Docs 4 Business.

I added search.scopes in the configuration to be able to scale configuration per scope. This could all be designed in more detail.

@humitos
Copy link
Member

humitos commented Sep 15, 2023

This issue seems related to #7217

I think that users don't really want to disable the "server side search", what they want to disable is the "integration Read the Docs injects on their documentation and go back to the doctool original search". Now, that can be done by disabling the search addon.

I don't see too much value on disabling them from dashboard search, so I don't think we need a config for that. In any case, feel free to re-open if you consider.

@humitos humitos closed this as completed Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

3 participants