Bug 19542: Add Elasticsearch information in the 'About' page
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 31 Oct 2017 14:29:28 +0000 (11:29 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 11 Dec 2017 17:30:42 +0000 (14:30 -0300)
commita0e44e192003541c2132c94df92cf8372ec30b92
tree8ff2798934dada576ee3092e2d044938ca6dd774
parentf57c3b36ea55612d81da7eaa8f75efe9126f9703
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>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt