-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Search: use alias to link to search results of subprojects #7757
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
Conversation
Currently we are showing `(result from {subproject_slug})` instead of the chosen alias. With this now we can show the proper alias. Also, start tracking the doctype of the version (it changes when the version changes so we are good). With this we can have the correct urls for all projects https://github.com/readthedocs/readthedocs.org/blob/1675fd3ea55947ef1de681c87df625ff5bc43abd/readthedocs/search/serializers.py#L113
4b40524
to
05cc10a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good approach. I dunno about VersionData having project_alias
in it though. That feels messy and confusing, but I guess its fine for now.
@@ -69,6 +69,7 @@ class PageDocument(RTDDocTypeMixin, Document): | |||
# Metadata | |||
project = fields.KeywordField(attr='project.slug') | |||
version = fields.KeywordField(attr='version.slug') | |||
doctype = fields.KeywordField(attr='version.documentation_type') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this require reindexing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but we can do it the next year, we aren't using it yet (still querying from the db or falling back to None). Tracking it here #7762.
Yeah, I was thinking about having a structure like |
b179719
to
33ed079
Compare
I have changed it to use another structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good 👍
Currently we are showing
(result from {subproject_slug})
instead of the chosen alias.
With this now we can show the proper alias. The alias is tracked in the VersionData namedtuple that is passed into the context.
Also, start tracking the doctype of the version (it changes when the
version changes so we are good).
With this we can have the correct urls for all projects
readthedocs.org/readthedocs/search/serializers.py
Line 113 in 1675fd3