[FC-0040] feat: update search index when object tags change - #647
Conversation
89d451c to
b2dc9a4
Compare
0d444e4 to
21b8139
Compare
There was a problem hiding this comment.
I needed to set update_metadata=True here, because without it, it was creating new documents when tags are updated, rather than updating the existing one.
There was a problem hiding this comment.
I think the new documents' issue is unrelated to this parameter.
We changed the way the ID hash was generated upstream, so the first time you tag an object (after the update), a new document is generated. Could you check if this was the case?
If so, using update_metadata=False should work.
There was a problem hiding this comment.
Also, adding Tags to a LibraryComponent if passing here (and falling).
A suggestion is to refactor and create a new update function for tagging only that can handle both types of blocks calling searchable_doc_for_library_block or searchable_doc_for_course_block (and eliminate the update_metadata and update_tags parameters from the task). But it's up to you!
There was a problem hiding this comment.
Could you check if this was the case?
If so, using update_metadata=False should work.
Yes -- that seemed to fix it and using update_metadata=False now works! I updated it.
I also added handling tagging for library blocks, I just opted for checking the type of the object_id for the content object and choosing the correct method based on that.
There was a problem hiding this comment.
This was needed to clear out tags in the index when unselecting all tags for the block, it would remain the last value otherwise because the Fields.tags value would not be included.
There was a problem hiding this comment.
Might be worth mentioning that in the code as a comment :)
61d72bb to
4a85a61
Compare
f1a94f3 to
a2e9d2a
Compare
rpenido
left a comment
There was a problem hiding this comment.
Hi @yusuf-musleh! Good work here!
I left some suggestions and questions in the review.
a2e9d2a to
4a55c89
Compare
There was a problem hiding this comment.
Also I wonder, what's an object_id? What does it look like?
There was a problem hiding this comment.
The object_id is the id of the course or library block as a string that is being tagged. For example:
block-v1:SampleTaxonomyOrg2+STC1+2023_1+type@vertical+block@f8de78f0897049ce997777a3a31b6ea0
There was a problem hiding this comment.
Can we add that explanation to the event data docstring? Here that would address all my comments. Thank you!
There was a problem hiding this comment.
I left a few comments regarding openedx/openedx-events#327. Also, is this PR going to be open against upstream?
8f39fc6 to
cdde7d7
Compare
|
Thanks @rpenido and @mariajgrimaldi for your reviews! I've addressed your comments.
Yes, this PR should be opened against upstream master once the base of this PR gets merged. |
b7aef89 to
45b6bf9
Compare
…stones-16b82db feat: Upgrade Python dependency edx-milestones
fix: SSO self-serve tool invalid entityId parsing Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
…thon_3.11 Make Tests Python 3.11 Compatible
…dx-enterprise-68b3753 feat: Upgrade Python dependency edx-enterprise
…lash feat!: Remove the django-splash app.
feat: re-expose deprecated fragments as passthrough Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master` Co-authored-by: connorhaugh <connorhaugh@users.noreply.github.com> Co-authored-by: connorhaugh <49422820+connorhaugh@users.noreply.github.com>
Update to a Python 3.11 compatible version Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
Update to a Python 3.11 compatible version Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
|
@yusuf-musleh I found a small but significant bug, so I pushed a fix to your PR. And (unrelated) there are some conflicts now. Could you please rebase or merge master into this, then ping me to merge it? |
There was a problem hiding this comment.
This docstring is out of date - we don't have include_tags=True anymore
This reverts commit f866545.
…toring-1eb92a3 feat: Upgrade Python dependency edx-proctoring
…-1eb92a3 feat: Upgrade Python dependency edx-rbac
This takes care of updating tags data in search index for both course and library blocks.
b15b9d9 to
32d7d09
Compare
d474406 to
8fc6c45
Compare
@bradenmacdonald Got it, I've addressed your comments, rebased/fixed conflicts and created a new PR off master, thats good to go (openedx#34559). So I'm closing this PR in favor of that one. |
Description
This PR implements updating search index with object tags whenever they change, based on the new
CONTENT_OBJECT_TAGS_CHANGEDevent.Supporting Information
CONTENT_OBJECT_TAGS_CHANGEDsignal openedx/openedx-events#327Testing Instructions
CONTENT_OBJECT_TAGS_CHANGEDsignal openedx/openedx-events#327 and make sure it is accessible from your devstack, and install it locallypip uninstall openedx-eventspip install -e path/to/openedx-events/meilisearchsetup locally, follow the setup instructions here https://github.com/open-craft/tutor-contrib-meilisearchtutor dev run cms bashand./manage.py cms reindex_studioTagsfield in the index document for the block has been updated to reflect that changes you made.Prinvate-ref: FAL-3691