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

task/FP-982: Add rebuild_index haystack signal processor #189

Merged
merged 3 commits into from
Apr 14, 2021

Conversation

rstijerina
Copy link
Member

Overview

On a document publish, unpublish, or delete event, we want the cms index to rebuild. This adds a new signal processor that hooks into Haystack, and subclasses the BaseSignalProcessor class.

Notes:

An improvement would be to add/remove the document from the index instead of rebuilding, but I had trouble updating the index with the instance object returned from the post_publish signal. Since we have relatively few documents and activity on each cms, the occasional rebuild_index call will not be a resource burden.

Testing:

  1. Load the cms locally, and add an unpublished document.
  2. Curl localhost:9201/cms-dev-cms/_search and verify the document is not in the index
  3. Publish the document, curl localhost:9201/cms-dev-cms/_search, and verify the document is now there
  4. Unpublish or delete the document, curl localhost:9201/cms-dev-cms/_search, and verify the document is gone

@rstijerina rstijerina requested review from taoteg and wesleyboar April 12, 2021 22:36
Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elegant.

Testing

  • ✓ Confirm index did not auto-update on main.
  • ✓ Confirm publish of edited page updates index.
    • "Text" plugin addition
    • "Text" plugin change
  • ✓ Confirm page removal updates index.
  • ✓ Confirm page addition (after publish) updates index.

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to nitpick, but at least let Bob McNewguy know this is search-related. A haystack signal process who what, now? I get it, but I sure didn't used to.

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for mentioning search!

@rstijerina rstijerina merged commit 342cad9 into main Apr 14, 2021
@rstijerina rstijerina deleted the task/FP-982 branch April 14, 2021 17:51
wesleyboar added a commit that referenced this pull request Apr 21, 2021
This reverts commit 342cad9, reversing
changes made to 27958c4.

To test cause of 500 errors on page publish on neuronex, protx, core.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants