Bug 26507 - New items not indexed
Summary: New items not indexed
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Nick Clemens
QA Contact:
URL:
Keywords:
Depends on: 23463
Blocks: 25265 26972
  Show dependency treegraph
 
Reported: 2020-09-22 13:59 UTC by Andrew Fuerste-Henry
Modified: 2021-06-14 21:31 UTC (History)
5 users (show)

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


Attachments
Bug 26507: Index records after storing new item (2.12 KB, patch)
2020-09-22 14:24 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26507: Index records after storing new item (2.18 KB, patch)
2020-09-22 18:23 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 26507: Elasticsearch - Index records after storing new item (2.25 KB, patch)
2020-09-23 19:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26507: [20.05.x] Elasticsearch - Index records after storing new item (2.29 KB, patch)
2020-09-28 16:38 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-09-22 13:59:54 UTC
When adding a new item under ES, that item is not automatically indexed. It is indexed if subsequently edited and saved.

To recreate:
- find/create a bib with no items
- add an item with barcode "abc123"
- do a general keyword search for "abc123," see your bib is not in the results
- perform a search that includes your bib in the results, confirm it shows as having no items
- click through to bib details, confirm it shows your item here
- edit and save your item
- confirm barcode is now searchable
Comment 1 Nick Clemens 2020-09-22 14:24:02 UTC
Created attachment 110558 [details] [review]
Bug 26507: Index records after storing new item

Currently Item->store indexes the record before the DB update - that is wrong

To test:
 1 - Find/create a bib with no items
 2 - add an item with barcode "abc123"
 3 - do a general keyword search for "abc123," see your bib is not in the results
 4 - perform a search that includes your bib in the results, confirm it shows as having no items
 5 - click through to bib details, confirm it shows your item here
 6 - edit and save your item
 7 - confirm barcode is now searchable
 8 - apply patches
 9 - Add a new item "cde456"
10 - Confirm it returns in searches
11 - Edit 'cde456' and change barcode to 'fgh789'
12 - Confirm the new abrcode is searchable
Comment 2 Andrew Fuerste-Henry 2020-09-22 18:23:03 UTC
Created attachment 110567 [details] [review]
Bug 26507: Index records after storing new item

Currently Item->store indexes the record before the DB update - that is wrong

To test:
 1 - Find/create a bib with no items
 2 - add an item with barcode "abc123"
 3 - do a general keyword search for "abc123," see your bib is not in the results
 4 - perform a search that includes your bib in the results, confirm it shows as having no items
 5 - click through to bib details, confirm it shows your item here
 6 - edit and save your item
 7 - confirm barcode is now searchable
 8 - apply patches
 9 - Add a new item "cde456"
10 - Confirm it returns in searches
11 - Edit 'cde456' and change barcode to 'fgh789'
12 - Confirm the new abrcode is searchable

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Comment 3 Katrin Fischer 2020-09-23 19:44:51 UTC
Created attachment 110620 [details] [review]
Bug 26507: Elasticsearch - Index records after storing new item

Currently Item->store indexes the record before the DB update - that is wrong

To test:
 1 - Find/create a bib with no items
 2 - add an item with barcode "abc123"
 3 - do a general keyword search for "abc123," see your bib is not in the results
 4 - perform a search that includes your bib in the results, confirm it shows as having no items
 5 - click through to bib details, confirm it shows your item here
 6 - edit and save your item
 7 - confirm barcode is now searchable
 8 - apply patches
 9 - Add a new item "cde456"
10 - Confirm it returns in searches
11 - Edit 'cde456' and change barcode to 'fgh789'
12 - Confirm the new abrcode is searchable

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2020-09-23 20:16:10 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Chad Billman 2020-09-25 17:58:03 UTC
Any chance this will be backported to 20.05.x?
Comment 6 Katrin Fischer 2020-09-25 18:48:19 UTC
(In reply to chad from comment #5)
> Any chance this will be backported to 20.05.x?

It' always up to the RMaints, but the usual rule of thumb is that bug fixes will be backported if the bug exists in the earlier version.
Comment 7 Lucas Gass 2020-09-28 15:40:19 UTC
does not apply cleanly to 20.05.x, if needed please rebase
Comment 8 Nick Clemens 2020-09-28 16:38:03 UTC
Created attachment 110879 [details] [review]
Bug 26507: [20.05.x] Elasticsearch - Index records after storing new item

Currently Item->store indexes the record before the DB update - that is wrong

To test:
 1 - Find/create a bib with no items
 2 - add an item with barcode "abc123"
 3 - do a general keyword search for "abc123," see your bib is not in the results
 4 - perform a search that includes your bib in the results, confirm it shows as having no items
 5 - click through to bib details, confirm it shows your item here
 6 - edit and save your item
 7 - confirm barcode is now searchable
 8 - apply patches
 9 - Add a new item "cde456"
10 - Confirm it returns in searches
11 - Edit 'cde456' and change barcode to 'fgh789'
12 - Confirm the new abrcode is searchable

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Lucas Gass 2020-09-28 17:52:08 UTC
backported to 20.05.x for 20.05.05
Comment 10 Aleisha Amohia 2020-10-19 22:55:20 UTC
missing dependencies, not backported to 19.11.x
Comment 11 Jonathan Druart 2020-11-10 08:58:13 UTC
This caused bug 26972. Nick, can you have a look please?