Skip to content

Return relative URLs in indoc search results #7311

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
stsewd opened this issue Jul 22, 2020 · 2 comments · Fixed by #7376
Closed

Return relative URLs in indoc search results #7311

stsewd opened this issue Jul 22, 2020 · 2 comments · Fixed by #7376
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@stsewd
Copy link
Member

stsewd commented Jul 22, 2020

This will save us one query for the domain, and also not change the current domain.

I think it makes sense to add it into the new api #7255

@stsewd stsewd added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Jul 22, 2020
@agjohnson
Copy link
Contributor

It would be helpful to audit why we were requiring this on search results and if there is a strong reason (still?) to require the absolute URL. I'm assuming we did this because it was easiest to use our resolver to be able to support subproject results, which would trigger the domain part of the resolver as well. For most API interactions, perhaps what we really need is a URL path relative to the domain name used in the request.

@stsewd
Copy link
Member Author

stsewd commented Jul 22, 2020

I think the main reason was we were hitting the API from readthedocs.org/api/, but now we are hitting the api from the same domain of the docs mydocs.readthedocs.io/_/api/docsearch/ (so this makes it more clear how to concatenate the results), and we were using the same code for the results from the dashboard. Subprojects share the same domain, so it shouldn't be a problem. We can also return canonical project domain in the api (as an extra field) just in case.

stsewd added a commit that referenced this issue Aug 10, 2020
stsewd added a commit that referenced this issue Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants