On top of 25277 authorities are not searchable under elasticsearch - query is built on bib fields
Created attachment 103697 [details] [review] Bug 25278: Retrieve correct search fields for authorities
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
Created attachment 103699 [details] [review] Bug 25278: Retrieve correct search fields for authorities
Created attachment 103700 [details] [review] Bug 25278: Unit tests
What about the other occurrences?
Created attachment 103793 [details] [review] Bug 25278: (follow-up) Fix other occurrences
Created attachment 104896 [details] [review] Bug 25278: Unit tests Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Created attachment 104897 [details] [review] Bug 25278: Retrieve correct search fields for authorities Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Created attachment 104898 [details] [review] Bug 25278: (follow-up) Fix other occurrences Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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 ^^")
Nick, 4 occurrences, please move that to a method.
Created attachment 104939 [details] [review] Bug 25278: add clear_search_fields_cache method
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>
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>
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>
Created attachment 104947 [details] [review] Bug 25278: add clear_search_fields_cache method Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nice work everyone! Pushed to master for 20.05
backported to 19.11.x for 19.11.06
missing dependencies for 19.05.x, no backport