[Bug 40986] New: Add some reindexing examples to rebuild_elasticsearch.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40986 Bug ID: 40986 Summary: Add some reindexing examples to rebuild_elasticsearch.pl Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: domm@plix.at QA Contact: testopia@bugs.koha-community.org I want to document some examples of "advanced" usage of rebuild_elasticsearch.pl using --where SQL I think the best place is to add them to the POD of the script itself (because in my experience this has the highest success rate of keeping it up to date) We could then add to the docs / the wiki etc instructions on how to show this examples (i.e. `rebuild_elasticsearch.pl --help`) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40986 --- Comment #1 from Thomas Klausner <domm@plix.at> --- Created attachment 187703 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187703&action=edit Bug 40986: add examples to rebuild_elasticsearch.pl --man This commit adds a bunch of example to rebuild_elasticsearch.pl --man, mostly about passing custom sql via --where. It also fixes a few trivial issues in rebuild_elasticsearch.pl and adds a note to debian/scripts/koha-elasticsearch to point people to the extended docs Test plan(s): 1: No examples in detailed help * run: misc/search_tools/rebuild_elasticsearch.pl --man * After OPTIONS (scroll down a bit with the down-arrow or hit space) the section IMPLEMENTATION is shown. * No EXAMPLES section 2: Ugly error message: * run: misc/search_tools/rebuild_elasticsearch.pl --processes 2 --authid 123 * output: "Argument p|processes cannot be combined with bn|bnumber or ai|authid at misc/search_tools/rebuild_elasticsearch.pl line 163." * Notice "at misc/search_tools/rebuild_elasticsearch.pl line 163" 3: Warning: * run: misc/search_tools/rebuild_elasticsearch.pl -v --biblios --where 'biblionumber = -1' * output: [9574] Checking state of biblios index [9574] Indexing biblios [9574] Committing final records... Use of uninitialized value in string eq at misc/search_tools/rebuild_elasticsearch.pl line 365. [9574] Total 0 records indexed * Notice the warning "Use of uninitialized value.." 4: Error when using --where without -b or -a * run: misc/search_tools/rebuild_elasticsearch.pl -v --where 'biblionumber = 1' * output: misc/search_tools/rebuild_elasticsearch.pl -v --where 'biblionumber = 420' ... DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'biblionumber' in 'where clause' at /kohadevbox/koha/Koha/MetadataRecord/Authority.pm line 239 * The script dies, because auth_header has not column biblionumber and we where running --where on both tables. 5: No hint about reindex_elasticsearch in koha-elasticsearch * run: debian/scripts/koha-elasticsearch --help * There is no hint about reindex_elasticsearch.pl Now apply the patch. No need to restart anything 1: examples are shown in detailed help * run: misc/search_tools/rebuild_elasticsearch.pl --man * after OPTIONS you will find a EXAMPLES section listing various use cases 2: Ugly error message is not ugly anymore * run: misc/search_tools/rebuild_elasticsearch.pl --processes 2 --authid 123 * output: Argument p|processes cannot be combined with bn|bnumber or ai|authid * no more "at blabla line ..." 3: Warning: * run: misc/search_tools/rebuild_elasticsearch.pl -v --biblios --where 'biblionumber = -1' * output: [9574] Checking state of biblios index [9574] Indexing biblios [9574] Committing final records... [9574] Total 0 records indexed * Notice the warning "Use of uninitialized value.." is gone 4: Error when using --where without -b or -a * run: misc/search_tools/rebuild_elasticsearch.pl -v --where 'biblionumber = 1' * output: Argument w|where must be combined with either b|biblios or a|authorities * and the script aborts. 5: koha-elasticsearch mentions reindex_elasticsearch.pl * run: debian/scripts/koha-elasticsearch --help * There **is** a hint about reindex_elasticsearch.pl Now apply the patch. No need to restart anything Sponsored-by: HKS3 Sponsored-by: Koha DACH Hackfest -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40986 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |domm@plix.at |ity.org | Patch complexity|--- |Trivial patch Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40986 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40986 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Comma delimited| |HKS3, Koha DACH Hackfest list of Sponsors| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40986 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187703|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40986 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 191999 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191999&action=edit Bug 40986: add examples to rebuild_elasticsearch.pl --man This commit adds a bunch of example to rebuild_elasticsearch.pl --man, mostly about passing custom sql via --where. It also fixes a few trivial issues in rebuild_elasticsearch.pl and adds a note to debian/scripts/koha-elasticsearch to point people to the extended docs Test plan(s): 1: No examples in detailed help * run: misc/search_tools/rebuild_elasticsearch.pl --man * After OPTIONS (scroll down a bit with the down-arrow or hit space) the section IMPLEMENTATION is shown. * No EXAMPLES section 2: Ugly error message: * run: misc/search_tools/rebuild_elasticsearch.pl --processes 2 --authid 123 * output: "Argument p|processes cannot be combined with bn|bnumber or ai|authid at misc/search_tools/rebuild_elasticsearch.pl line 163." * Notice "at misc/search_tools/rebuild_elasticsearch.pl line 163" 3: Warning: * run: misc/search_tools/rebuild_elasticsearch.pl -v --biblios --where 'biblionumber = -1' * output: [9574] Checking state of biblios index [9574] Indexing biblios [9574] Committing final records... Use of uninitialized value in string eq at misc/search_tools/rebuild_elasticsearch.pl line 365. [9574] Total 0 records indexed * Notice the warning "Use of uninitialized value.." 4: Error when using --where without -b or -a * run: misc/search_tools/rebuild_elasticsearch.pl -v --where 'biblionumber = 1' * output: misc/search_tools/rebuild_elasticsearch.pl -v --where 'biblionumber = 420' ... DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'biblionumber' in 'where clause' at /kohadevbox/koha/Koha/MetadataRecord/Authority.pm line 239 * The script dies, because auth_header has not column biblionumber and we where running --where on both tables. 5: No hint about reindex_elasticsearch in koha-elasticsearch * run: debian/scripts/koha-elasticsearch --help * There is no hint about reindex_elasticsearch.pl Now apply the patch. No need to restart anything 1: examples are shown in detailed help * run: misc/search_tools/rebuild_elasticsearch.pl --man * after OPTIONS you will find a EXAMPLES section listing various use cases 2: Ugly error message is not ugly anymore * run: misc/search_tools/rebuild_elasticsearch.pl --processes 2 --authid 123 * output: Argument p|processes cannot be combined with bn|bnumber or ai|authid * no more "at blabla line ..." 3: Warning: * run: misc/search_tools/rebuild_elasticsearch.pl -v --biblios --where 'biblionumber = -1' * output: [9574] Checking state of biblios index [9574] Indexing biblios [9574] Committing final records... [9574] Total 0 records indexed * Notice the warning "Use of uninitialized value.." is gone 4: Error when using --where without -b or -a * run: misc/search_tools/rebuild_elasticsearch.pl -v --where 'biblionumber = 1' * output: Argument w|where must be combined with either b|biblios or a|authorities * and the script aborts. 5: koha-elasticsearch mentions reindex_elasticsearch.pl * run: debian/scripts/koha-elasticsearch --help * There **is** a hint about reindex_elasticsearch.pl Now apply the patch. No need to restart anything Sponsored-by: HKS3 Sponsored-by: Koha DACH Hackfest Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org