Bug 19462: Add a koha-elasticsearch command
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 13 Oct 2017 18:11:07 +0000 (15:11 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 27 Oct 2017 17:10:31 +0000 (14:10 -0300)
commit3cb853ed8feda20b0f619278026aed283d7fa2e5
tree2e50893d3d92355b416b238f75807e5d2c52ea24
parente9a7333833dbfa4e5f5514afb4654981a7691336
Bug 19462: Add a koha-elasticsearch command

This patch adds a new command to be used for Elasticsearch-related
tasks.

The current implementation only offers the --rebuild action switch,
that allows reindexing Elasticsearch on a per-instance basis as we are
used to with the rest of the koha-* commands.

Other options could be added in a future: --status (ES server status
report, etc).

To test:
- Apply the whole patchset
- Have a suitable Koha+Elasticsearch setup [1]
- Run:
  $ reset_all
- Run:
  $ man koha-elasticsearch
=> SUCCESS: A pretty man page is displayed covering all options
- Run:
  $ sudo koha-elasticsearch blah
=> SUCCESS: The script fails because blah is not a valid instance name
- Run:
  $ sudo koha-elasticsearch -v kohadev
=> SUCCESS: Reindex happens!
- Try the -a, -b and -c option switches
- Sign off happily :-D

Sponsored-by: ByWater Solutions
[1] This is straightforward if you are using KohaDevBox and created the
box using: $ KOHA_ELASTICSEARCH=1 vagrant up

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
debian/koha-common.install
debian/scripts/koha-elasticsearch [new file with mode: 0755]