Bugzilla – Attachment 147560 Details for
Bug 33108
We need a way to launch the ES indexer automatically
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33108: Add is_elasticsearch_enabled method to tools
Bug-33108-Add-iselasticsearchenabled-method-to-too.patch (text/plain), 1.50 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-03-01 13:28:20 UTC
(
hide
)
Description:
Bug 33108: Add is_elasticsearch_enabled method to tools
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-03-01 13:28:20 UTC
Size:
1.50 KB
patch
obsolete
>From dd681358b4b465e3338a7557da8a54a296733b98 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 1 Mar 2023 10:22:22 -0300 >Subject: [PATCH] Bug 33108: Add is_elasticsearch_enabled method to tools > >This patch adds a way to query if an instance is configured to use ES. > >To test: >1. Apply this patch >2. Enter KTD as root: > $ ktd --shell --root >3. Run: > $ source /kohadevbox/koha/debian/scripts/koha-functions.sh >4. Run: > $ is_elasticsearch_enabled hola >=> FAIL: Instance hola doesn't exist (hopefully :-P) >5. Have the SearchEngine syspref set to Elasticsearch >6. Run: > $ is_elasticsearch_enabled kohadev && echo "it is" || echo "it isn't" >=> SUCCESS: "it is" gets printed >7. Set SearchEngine to Zebra >8. Repeat 6 >=> SUCCESS: "it isn't" gets printed >9. Sign off :-D >--- > debian/scripts/koha-functions.sh | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh >index 5b81d177ccd..72f64b6de72 100755 >--- a/debian/scripts/koha-functions.sh >+++ b/debian/scripts/koha-functions.sh >@@ -330,6 +330,19 @@ is_z3950_running() > fi > } > >+is_elasticsearch_enabled() >+{ >+ local instancename=$1 >+ >+ search_engine=$(koha-shell $instancename -c "/usr/share/koha/bin/admin/koha-preferences get SearchEngine") >+ >+ if [ "$search_engine" == "Elasticsearch" ]; then >+ return 0 >+ else >+ return 1 >+ fi >+} >+ > adjust_paths_dev_install() > { > # Adjust KOHA_HOME, PERL5LIB for dev installs, as indicated by >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33108
:
147560
|
147574
|
147575
|
147576
|
147617
|
147618
|
147619
|
147620
|
147701
|
147702
|
148328
|
148329
|
148330
|
148331
|
148332