Summary: | Add a koha-elasticsearch command | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Command-line Utilities | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Nick Clemens (kidclamp) <nick> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, mtompset, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19465 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
A new command-line script is added for handling Elasticsearch indexing-related tasks for each Koha instance.
|
|
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 19462: Add a koha-elasticsearch command
Bug 19462: Add koha-elasticsearch documentation Bug 19462: Add a koha-elasticsearch command Bug 19462: Add koha-elasticsearch documentation Bug 19462: Add a koha-elasticsearch command Bug 19462: Add koha-elasticsearch documentation |
Description
Tomás Cohen Arazi (tcohen)
2017-10-13 15:29:51 UTC
Created attachment 68091 [details] [review] 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> Created attachment 68092 [details] [review] Bug 19462: Add koha-elasticsearch documentation Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 68118 [details] [review] 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> Created attachment 68119 [details] [review] Bug 19462: Add koha-elasticsearch documentation Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> After getting ES to work, and adjusting my expectations of searches, this runs minimally well. It could be polished on edge error cases, but nothing that merits a Failed QA in my opinion. For example, try a "-c=2" instead of a "-c 2". Ugliness ensues. (In reply to M. Tompsett from comment #5) > After getting ES to work, and adjusting my expectations of searches, this > runs minimally well. It could be polished on edge error cases, but nothing > that merits a Failed QA in my opinion. > > For example, try a "-c=2" instead of a "-c 2". Ugliness ensues. Are we supposed to support -c=2? Created attachment 68617 [details] [review] 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> Created attachment 68618 [details] [review] Bug 19462: Add koha-elasticsearch documentation 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> More options can be added in the future, but this will ease testing and is a great start (In reply to Tomás Cohen Arazi from comment #6) > (In reply to M. Tompsett from comment #5) > > For example, try a "-c=2" instead of a "-c 2". Ugliness ensues. > > Are we supposed to support -c=2? Not expressly. But sometimes, some scripts are that format, and sometimes they are not. I'm not sure which is the officially preferred way for scripts in general, but I thought I would mention it as a valid weakness, since for some strange reason I typed that instead of what was expected and documented. (In reply to M. Tompsett from comment #10) > (In reply to Tomás Cohen Arazi from comment #6) > > (In reply to M. Tompsett from comment #5) > > > For example, try a "-c=2" instead of a "-c 2". Ugliness ensues. > > > > Are we supposed to support -c=2? > > Not expressly. But sometimes, some scripts are that format, and sometimes > they are not. I'm not sure which is the officially preferred way for scripts > in general, but I thought I would mention it as a valid weakness, since for > some strange reason I typed that instead of what was expected and documented. I don't think we should take care of non-documented ways of passing parameters. Either the manpage or the --help switch propose that syntax. I don't even think we should support multiple ways of passing the parameters, as it tends to this: confussion. Pushed to master for 17.11, thanks to everybody involved! |