Skip to content
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

[FC-0040] feat: update search index when object tags change #34559

Conversation

yusuf-musleh
Copy link
Contributor

Description

This PR implements updating search index with object tags whenever they change, based on the new CONTENT_OBJECT_TAGS_CHANGED event.

Supporting Information

Testing Instructions

  • Run your local devstack on this branch
  • Clone the openedx-events repo on this branch [FC-0040] feat: Add CONTENT_OBJECT_TAGS_CHANGED signal openedx-events#327 and make sure it is accessible from your devstack, and install it locally
    • pip uninstall openedx-events
    • pip install -e path/to/openedx-events/
  • Make sure you have meilisearch setup locally, follow the setup instructions here https://github.com/open-craft/tutor-contrib-meilisearch
  • Make sure you also have some sample taxonomies/tags, you can add some from here: https://github.com/open-craft/taxonomy-sample-data
  • Run tutor dev run cms bash and ./manage.py cms reindex_studio
  • View the resulting index at http://meilisearch.local.edly.io:7700/ (see tutor-contrib-meilisearch README for how to get the API key to log in)
  • Check and confirm that is an index with documents in it. If you already have some tags applied to blocks, they will appear there
  • Go back to studio, and add/update tags in a block
  • Go back to meilisearch dashboard, and confirm that the Tags field in the index document for the block has been updated to reflect that changes you made.
    • Note: I recommend having a easily identifiable name for the block/unit that you added tags to so you can easily search for it
    • NOTE: Meilisearch seems to cache queries along with their results in the frontend, so if you simply search it might show you stale data (network tab shows no requests), especially if you're searching for the same query. Make sure you refresh the Meilisearch dashboard (http://meilisearch.local.edly.io:7700/) and then perform the search.
  • Repeat and confirm the above for both units and blocks

Prinvate-ref: FAL-3691

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 21, 2024
@openedx-webhooks
Copy link

Thanks for the pull request, @yusuf-musleh! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@bradenmacdonald bradenmacdonald merged commit a31ed92 into openedx:master Apr 22, 2024
66 checks passed
@bradenmacdonald bradenmacdonald deleted the yusuf-musleh/update-search-index-when-object-tags-change branch April 22, 2024 17:53
@openedx-webhooks
Copy link

@yusuf-musleh 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

KyryloKireiev pushed a commit to raccoongang/edx-platform that referenced this pull request Apr 24, 2024
)

* feat: Update search index when object tags updated

* feat: Update index when library block tags change

* refactor: Remove extra params

* docs: Add new event to hook events docs

* feat: Add and use upsert_block_tags_index_docs

This takes care of updating tags data in search index for both course and library blocks.

* chore: Update openedx-events

* fix: Update tests + include course block tags in reindex

* feat: Fix static-type issues + adjust tag_object

* fix: bug retrieving the Meilisearch API key UID (first time only)

* docs: Update comments

---------

Co-authored-by: Braden MacDonald <braden@opencraft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants