Created attachment 68861 [details] [review] Bug 19542: Add a check for ES configuration health This patch adds a new statuc function to Koha::SearchEngine::ElasticSearch which is instended to replace most of get_elasticsearch_params. This function reads the configuration from C4::Context->config('elasticsearch') and raises relevant exceptions when mandatory entries are missing. Its behaviour is covered by tests. To test: - Run: $ kshell k$ prove t/Koha/SearchEngine/Elasticsearch.t => SUCCESS: Tests pass! - Sign off :-D
Created attachment 68862 [details] [review] Bug 19542: Add Elasticsearch information in the 'About' page This patch adds Elasticsearch related information to the 'About' page. The information is gathered and displayed only when the 'SearchEngine' syspref is set to 'Elasticsearch'. It displays configured nodes, and the status: - Running - Not running In case it is running, it displays the defined indices and the document count on each. If there are configuration problems, exceptions are catch and a convenient warning message is displayed. To test: - Apply this patches - Run: $ kshell k$ prove t/Koha/SearchEngine/Elasticsearch.t => SUCCESS: Tests pass! - Have ES configured in your koha-conf.xml file (by default in kohadevbox) - Set the 'SearchEngine' syspref to 'Elasticsearch' - Comment out pieces of the elasticsearch-specific entries (server, index_name, the whole elasticsearch block). Reload on each change. => SUCCESS: Warning messages are displayed and make sense in the context of your changes. ----> the rest of the tests require having ES running on the dev env. This can be easily achieved by creating the kohadevbox using: $ KOHA_ELASTICSEARCH=1 vagrant up - Stop the 'elasticsearch' service: $ sudo service elasticsearch stop - Reload about.pl => SUCCESS: The configured nodes are displayed, and the status is 'not running' - Start the 'elasticsearch' service: $ sudo service elasticsearch start - Reload about.pl => SUCCESS: The configured nodes are displayed, the status is 'running' and created indices info is displayed, along with the document count on each index. - Sign off :-D
Created attachment 68863 [details] Screenshot: running ES
Created attachment 68864 [details] Screenshot: ES stopped
Created attachment 68935 [details] [review] Bug 19542: Add a check for ES configuration health This patch adds a new statuc function to Koha::SearchEngine::ElasticSearch which is instended to replace most of get_elasticsearch_params. This function reads the configuration from C4::Context->config('elasticsearch') and raises relevant exceptions when mandatory entries are missing. Its behaviour is covered by tests. To test: - Run: $ kshell k$ prove t/Koha/SearchEngine/Elasticsearch.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Created attachment 68936 [details] [review] Bug 19542: Add Elasticsearch information in the 'About' page This patch adds Elasticsearch related information to the 'About' page. The information is gathered and displayed only when the 'SearchEngine' syspref is set to 'Elasticsearch'. It displays configured nodes, and the status: - Running - Not running In case it is running, it displays the defined indices and the document count on each. If there are configuration problems, exceptions are catch and a convenient warning message is displayed. To test: - Apply this patches - Run: $ kshell k$ prove t/Koha/SearchEngine/Elasticsearch.t => SUCCESS: Tests pass! - Have ES configured in your koha-conf.xml file (by default in kohadevbox) - Set the 'SearchEngine' syspref to 'Elasticsearch' - Comment out pieces of the elasticsearch-specific entries (server, index_name, the whole elasticsearch block). Reload on each change. => SUCCESS: Warning messages are displayed and make sense in the context of your changes. ----> the rest of the tests require having ES running on the dev env. This can be easily achieved by creating the kohadevbox using: $ KOHA_ELASTICSEARCH=1 vagrant up - Stop the 'elasticsearch' service: $ sudo service elasticsearch stop - Reload about.pl => SUCCESS: The configured nodes are displayed, and the status is 'not running' - Start the 'elasticsearch' service: $ sudo service elasticsearch start - Reload about.pl => SUCCESS: The configured nodes are displayed, the status is 'running' and created indices info is displayed, along with the document count on each index. - Sign off :-D Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
*** Bug 18431 has been marked as a duplicate of this bug. ***
Created attachment 69615 [details] [review] Bug 19542: Add a check for ES configuration health This patch adds a new statuc function to Koha::SearchEngine::ElasticSearch which is instended to replace most of get_elasticsearch_params. This function reads the configuration from C4::Context->config('elasticsearch') and raises relevant exceptions when mandatory entries are missing. Its behaviour is covered by tests. To test: - Run: $ kshell k$ prove t/Koha/SearchEngine/Elasticsearch.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 69616 [details] [review] Bug 19542: Add Elasticsearch information in the 'About' page This patch adds Elasticsearch related information to the 'About' page. The information is gathered and displayed only when the 'SearchEngine' syspref is set to 'Elasticsearch'. It displays configured nodes, and the status: - Running - Not running In case it is running, it displays the defined indices and the document count on each. If there are configuration problems, exceptions are catch and a convenient warning message is displayed. To test: - Apply this patches - Run: $ kshell k$ prove t/Koha/SearchEngine/Elasticsearch.t => SUCCESS: Tests pass! - Have ES configured in your koha-conf.xml file (by default in kohadevbox) - Set the 'SearchEngine' syspref to 'Elasticsearch' - Comment out pieces of the elasticsearch-specific entries (server, index_name, the whole elasticsearch block). Reload on each change. => SUCCESS: Warning messages are displayed and make sense in the context of your changes. ----> the rest of the tests require having ES running on the dev env. This can be easily achieved by creating the kohadevbox using: $ KOHA_ELASTICSEARCH=1 vagrant up - Stop the 'elasticsearch' service: $ sudo service elasticsearch stop - Reload about.pl => SUCCESS: The configured nodes are displayed, and the status is 'not running' - Start the 'elasticsearch' service: $ sudo service elasticsearch start - Reload about.pl => SUCCESS: The configured nodes are displayed, the status is 'running' and created indices info is displayed, along with the document count on each index. - Sign off :-D Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 69617 [details] [review] Bug 19542 - QA Followup: Remove debug warn
Ah, QA test tools complain of POD coverage for Exceptions
Created attachment 69699 [details] [review] Bug 19542: Use comma to separate indices Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 18.05, thanks to everybody involved!
--- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -22,6 +22,7 @@ use base qw(Class::Accessor); [...] +use Search::Elasticsearch; Hmm Can't locate Search/Elasticsearch.pm in @INC (you may need to install the Search::Elasticsearch module) (@INC contains: /usr/share/koha/masterclone /usr/share/koha/rma/lib /usr/share/koha/qa-tools /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/share/koha/masterclone/Koha/SearchEngine/Elasticsearch.pm line 33. BEGIN failed--compilation aborted at /usr/share/koha/masterclone/Koha/SearchEngine/Elasticsearch.pm line 33.
Created attachment 69730 [details] [review] Bug 19542: (QA follow-up) Remove module Resolve: Can't locate Search/Elasticsearch.pm in @INC (you may need to install the Search::Elasticsearch module) By removing the module Search::Elasticsearch. Test plan: [1] Check if module compiles now [2] Running updatedatabase now passes Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 69731 [details] [review] Bug 19542: (QA follow-up) Remove module Resolve: Can't locate Search/Elasticsearch.pm in @INC (you may need to install the Search::Elasticsearch module) By removing the module Search::Elasticsearch. Test plan: [1] Check if module compiles now [2] Running updatedatabase now passes Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Removing != commenting ;)
Comment on attachment 69731 [details] [review] Bug 19542: (QA follow-up) Remove module Removing this patch, since it is not a complete fix. But I still think this needs attention..
Awesome work all! Enhancement, skipping for 17.11