Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: adds sortable fields to studio content search index [FC-0059] #35103
feat: adds sortable fields to studio content search index [FC-0059] #35103
Changes from all commits
cf9ab01
5f71cc3
b8bf0bb
b7f8f8e
ecf0765
74a7ac8
224ec03
0ffd91e
cc67395
c1f7b05
ceaf314
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Hi @ormsbee 👋
I added this code to record the published date for library components in the Studio search index. However, it doesn't work, seemingly because components don't get publish records recorded when they are published -- only the parent library does.
However, there isn't a date available on the
component.versioning.published
ComponentVersion -- thepublished.created
matches thedraft.modified
date after publishing, and doesn't represent the actual date published.What would be the best way to address this issue?
CC @bradenmacdonald
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.
cf #35195
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.
And openedx/openedx-learning#204
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.
I don't remember if there's a good helper for it at the moment, but I think you can get the datetime when a Component was published by following these relations:
Component.publishable_entity -> PublishableEntity.published -> Published.publish_log_record -> PublishLogRecord.publish_log -> PublishLog. published_at
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.
My initial changes to
LibraryXBlockMetadata.from_component
brought this query count up to 14, because it usedcomponent.versioning.latest
.Using
component.versioning.draft
instead brought the query count down to 11, because the authoring API doesn't give us a more efficient way to fetch thepublished_at
date than from thelast_publish_log
.Welcome any advice on how to avoid the increased query count here!
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 an @ormsbee question if I'm correctly understanding that it's about efficiently fetching modified dates from learning core's
authoring
API.