Bug 25278 - Search fields cache must be separate for different indexes under Elasticsearch
Summary: Search fields cache must be separate for different indexes under Elasticsearch
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact:
URL:
Keywords:
Depends on: 13937 23137 25277
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-24 13:38 UTC by Nick Clemens
Modified: 2020-05-22 14:39 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06


Attachments
Bug 25278: Retrieve correct search fields for authorities (1.11 KB, patch)
2020-04-24 15:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25278: Retrieve correct search fields for authorities (1.98 KB, patch)
2020-04-24 16:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25278: Unit tests (2.69 KB, patch)
2020-04-24 16:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25278: (follow-up) Fix other occurrences (3.22 KB, patch)
2020-04-27 14:06 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25278: Unit tests (2.74 KB, patch)
2020-05-14 19:06 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 25278: Retrieve correct search fields for authorities (2.04 KB, patch)
2020-05-14 19:06 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 25278: (follow-up) Fix other occurrences (3.28 KB, patch)
2020-05-14 19:06 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 25278: add clear_search_fields_cache method (5.00 KB, patch)
2020-05-15 11:56 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25278: Unit tests (2.81 KB, patch)
2020-05-15 13:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25278: Retrieve correct search fields for authorities (2.11 KB, patch)
2020-05-15 13:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25278: (follow-up) Fix other occurrences (3.35 KB, patch)
2020-05-15 13:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25278: add clear_search_fields_cache method (5.07 KB, patch)
2020-05-15 13:18 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-04-24 13:38:10 UTC
On top of 25277 authorities are not searchable under elasticsearch - query is built on bib fields
Comment 1 Nick Clemens 2020-04-24 15:53:11 UTC
Created attachment 103697 [details] [review]
Bug 25278: Retrieve correct search fields for authorities
Comment 2 Nick Clemens 2020-04-24 15:56:20 UTC
When we are determining which fields to search we check the cache and retrieve if the search fields are not cached

It seems that although we check the index when retrieving the fields, we don't note the index when caching.

This means that authorities searches of the entire record can end up searching the biblio fields, and biblio searches will use the authorities fields if those are returned first.

We can fix this simply by adding the index to the cache key
Comment 3 Nick Clemens 2020-04-24 16:33:01 UTC
Created attachment 103699 [details] [review]
Bug 25278: Retrieve correct search fields for authorities
Comment 4 Nick Clemens 2020-04-24 16:33:04 UTC
Created attachment 103700 [details] [review]
Bug 25278: Unit tests
Comment 5 Jonathan Druart 2020-04-27 13:26:32 UTC
What about the other occurrences?
Comment 6 Nick Clemens 2020-04-27 14:06:18 UTC
Created attachment 103793 [details] [review]
Bug 25278: (follow-up) Fix other occurrences
Comment 7 Victor Grousset/tuxayo 2020-05-14 19:06:23 UTC
Created attachment 104896 [details] [review]
Bug 25278: Unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 8 Victor Grousset/tuxayo 2020-05-14 19:06:26 UTC
Created attachment 104897 [details] [review]
Bug 25278: Retrieve correct search fields for authorities

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 9 Victor Grousset/tuxayo 2020-05-14 19:06:30 UTC
Created attachment 104898 [details] [review]
Bug 25278: (follow-up) Fix other occurrences

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 10 Victor Grousset/tuxayo 2020-05-14 19:10:55 UTC
Applied only the tests; ran => failed
Then applied the fix => passed :D

(also looked at the code, nothing wrong noticed, though not much was understood ^^")
Comment 11 Jonathan Druart 2020-05-15 07:56:20 UTC
Nick, 4 occurrences, please move that to a method.
Comment 12 Nick Clemens 2020-05-15 11:56:13 UTC
Created attachment 104939 [details] [review]
Bug 25278: add clear_search_fields_cache method
Comment 13 Jonathan Druart 2020-05-15 13:18:24 UTC
Created attachment 104944 [details] [review]
Bug 25278: Unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Jonathan Druart 2020-05-15 13:18:28 UTC
Created attachment 104945 [details] [review]
Bug 25278: Retrieve correct search fields for authorities

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Jonathan Druart 2020-05-15 13:18:31 UTC
Created attachment 104946 [details] [review]
Bug 25278: (follow-up) Fix other occurrences

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Jonathan Druart 2020-05-15 13:18:35 UTC
Created attachment 104947 [details] [review]
Bug 25278: add clear_search_fields_cache method

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Martin Renvoize 2020-05-18 14:29:10 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 18 Joy Nelson 2020-05-19 23:06:14 UTC
backported to 19.11.x for 19.11.06
Comment 19 Lucas Gass 2020-05-22 14:39:55 UTC
missing dependencies for 19.05.x, no backport