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

Book search is failing to reindex correctly if events are changed (add/delete/reassociate) without updating work record #667

Closed
clmahoney opened this issue Jun 14, 2020 · 4 comments
Assignees
Labels

Comments

@clmahoney
Copy link

Describe the bug
When a work is altered on the test-admin site, the test-production site adds the new work but does not reindex the old work on the book sort page. For example, when I divided "Vanity Fair" from one periodical with 16 events to the periodical with 4 events and another entry for the novel Vanity Fair with 12 events, the production site shows the novel entry with 12 events but still shows the periodical work with 16 entries when it should only be 4. This is only wonky on the search page; when you click through to the individual work bibliography page, circulation page, and card page it does the expected 4 events.
RSK put it more concisely on Slack: the error is happening if you change events (especially add/delete/reassociate) without updating the work record.

To reproduce
Steps to reproduce the behavior:

  1. Change events for a work without altering the work entry itself
  2. See that the altered work does not show up with its changes in the book search page

Expected behavior
When events within a work are changed (added, deleted, or re-associated) the book search page should show the correct number of events.

Screenshots
Example of error with Vanity Fair:
Screen Shot 2020-06-13 at 10 54 43 PM

@clmahoney clmahoney added the bug label Jun 14, 2020
@rlskoeser
Copy link
Contributor

Have configured a nightly cron job to reindex works in the interim until this is resolved. The cron job should be turned off when this is fixed.

@rlskoeser rlskoeser self-assigned this Jul 6, 2020
rlskoeser added a commit that referenced this issue Jul 7, 2020
Add signal handlers to reindex work on event save/delete #667
@jkotin jkotin closed this as completed Jul 9, 2020
@jkotin jkotin reopened this Jul 22, 2020
@jkotin
Copy link

jkotin commented Jul 22, 2020

I went to the test admin site and created a new item -- 2020 by Virginia Woolf. I created one event -- a Hemingway borrow. I then went to the test site: the book was there, but the search page was showing 0 events.

I added another borrow to the same book -- by Stein -- and still 0 events on the search page. I don't know how I tested it differently earlier.

I added a borrow to a preexisting item -- Brooke's 1914. The search page only shows one event when there should be two.

@rlskoeser
Copy link
Contributor

@jkotin I think I figured out what's going on here — indexing was working if you saved generic events but not if you saved borrows and purchases. Please test to confirm that my fix resolves this.

@jkotin
Copy link

jkotin commented Jul 29, 2020

Yes, it works. I tried borrows, purchases, and generic -- the additional events showed up in search results and on bibliography page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants