Bug 30386 - Prevent search errors if deleted record still remains in search indexes
Summary: Prevent search errors if deleted record still remains in search indexes
Status: RESOLVED DUPLICATE of bug 29374
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-28 14:57 UTC by Kyle M Hall
Modified: 2022-05-12 19:29 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 30386: Prevent search errors if deleted record still remains in search indexes (1.26 KB, patch)
2022-03-28 15:10 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2022-03-28 14:57:51 UTC
If a bib is deleted, but for some reason doesn't get deleted from the search indexes, any search where that record is a result will produce the error:

Can't call method "items" on an undefined value at /usr/share/koha/lib/C4/Search.pm line 2064.
Comment 1 Kyle M Hall 2022-03-28 15:10:35 UTC
Created attachment 132349 [details] [review]
Bug 30386: Prevent search errors if deleted record still remains in search indexes

If a bib is deleted, but for some reason doesn't get deleted from the search indexes, any search where that record is a result will produce the error:

Can't call method "items" on an undefined value at /usr/share/koha/lib/C4/Search.pm line 2064.

Test Plan:
1) Enable item-level_itypes
2) Create 3 records in Koha that share a word
3) Search for that word, note your 3+ results
4) Delete one of those recordst from the database using koha-mysql
5) Search for the word again
6) Note the error!
7) Apply this patch
8) Search for the word again
9) Note you get results!
Comment 2 Owen Leonard 2022-04-04 11:30:38 UTC
I could not reproduce this error. I also tried this test plan:

1) Enable item-level_itypes
2) Create 3 records in Koha that share a word
3) Ran koha-rebuild-zebra
4) Search for that word, note your 3+ results
5) Ran koha-indexer --stop kohadev
6) delete from biblio where biblionumber = XXX;
7) Searched again, deleted record still returned along with the others.
Comment 3 Liz Rea 2022-04-07 13:30:39 UTC
This is for elastic search, I believe, not zebra.

Cheers,
Liz
Comment 4 Nick Clemens 2022-05-12 19:29:37 UTC

*** This bug has been marked as a duplicate of bug 29374 ***