Skip to content

Search: wrong link when including results from different projects #622

@stsewd

Description

@stsewd

Our search syntax allows including results from several no-related projects, which means each result will have a different URL that doesn't match the current domain. For example, in https://docs.beeware.org/en/latest/ search project:docs test and click on the result that says "from project docs", you'll get a 404 as it uses the relative path instead of an absolute URL.

href="${result.path}"

In the previous implementation for search, we covered this use case by checking if the result belongs to the current project or not, and if not, we used the full URL instead of the path.

https://github.com/readthedocs/readthedocs-sphinx-search/blob/aa5c8d70c0719475db6ae082eb7cf017027fc1a7/sphinx_search/static/js/rtd_sphinx_search.js#L269-L279

Metadata

Metadata

Assignees

Labels

AcceptedAccepted issue on our roadmapBugA bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions