To recreate: 0 - Have an environment with both ES and Zebra available 1 - Edit an authority record in the DB to force the 001 and the auth_id to be different update auth_header SET marcxml = REPLACE(marcxml,"1707","potato"); 2 - Reindex Zebra and ES 3 - View the record in zebra (commands below work on kohadevbox sample data) yaz-client unix:/var/run/koha/kohadev/authoritysocket base authorities find "computer program" show 1+14 Note that the relevant record has the auth id in the 001 even though the record doesn't 4 - View the record in Elasticsearch curl -X GET 'localhost:9200/koha_kohadev_authorities/data/1707?pretty' Note the 001 is indexed into local number, but the _id of the record matches authid 5 - Search authorities in the staff client for "Computer prorgram" using Zebra Note that you can find authid 1707 in the results and view it 6 - Switch search engine to ES and repeat Note that you have a result that links to authid=potato and it doesn't work
Created attachment 103376 [details] [review] Bug 25229: Return authid of record rather than 001
As far as I can tell, we do this for zebra in the background. Follow the recreation instructions and see that we index the authid as 001 even if the record is different, which is kinda crazy. We should at least be consistent. I have not included tests because we don't really yet have a way to fake ES for tests - we need bug 19821 as there are issues where records created for testing are indexed into ES if search engine config is set, but they don't get removed (for zebra they enter zebraqueue transactionally and are not committed) Everywhere this code is sued expects the correct authid afacit
Created attachment 103738 [details] [review] Bug 25229: Return authid of record rather than 001 Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Document _id field, in authorities ES index, is always authid
Tests please?
Created attachment 103759 [details] [review] Bug 25229: Unit test
Created attachment 103760 [details] [review] Bug 25229: Return authid of record rather than 001 Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Document _id field, in authorities ES index, is always authid
Created attachment 103761 [details] [review] Bug 25229: (follow-up) Move QueryBuilder test to Elasticsearch dir
Created attachment 103779 [details] [review] Bug 25229: Unit test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 103780 [details] [review] Bug 25229: Return authid of record rather than 001 Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Document _id field, in authorities ES index, is always authid Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 103781 [details] [review] Bug 25229: (follow-up) Move QueryBuilder test to Elasticsearch dir 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