Bugzilla – Attachment 91288 Details for
Bug 17851
Add Elasticsearch config to koha-conf.xml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17851 - Add elasticsearch config to koha-conf.xml
0001-Bug-17851-Add-elasticsearch-config-to-koha-conf.xml.patch (text/plain), 5.17 KB, created by
Johanna Räisä
on 2019-07-04 11:53:33 UTC
(
hide
)
Description:
Bug 17851 - Add elasticsearch config to koha-conf.xml
Filename:
MIME Type:
Creator:
Johanna Räisä
Created:
2019-07-04 11:53:33 UTC
Size:
5.17 KB
patch
obsolete
>From b1c67532f492e980bbc22f34abf6061b5ef841ff Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Thu, 5 Jan 2017 14:13:48 +0200 >Subject: [PATCH] Bug 17851 - Add elasticsearch config to koha-conf.xml > >Missing installer for debian packages. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com> >--- > Makefile.PL | 37 ++++++++++++++++++++++++++ > debian/templates/koha-conf-site.xml.in | 4 +-- > etc/koha-conf.xml | 4 +-- > rewrite-config.PL | 3 +++ > 4 files changed, 44 insertions(+), 4 deletions(-) > >diff --git a/Makefile.PL b/Makefile.PL >index 0a0d4b7a0e..69eae835b7 100644 >--- a/Makefile.PL >+++ b/Makefile.PL >@@ -228,6 +228,16 @@ Directory for Zebra's data files. > > Directory for Zebra's UNIX-domain sockets. > >+=item ELASTICSEARCH_SERVERS >+ >+Server:port of the Elasticsearch server to use, as a comma separated list: >+eg. 192.168.0.100:9200, localhost:9200 >+ >+=item ELASTICSEARCH_INDEX >+ >+Unique index in Elasticsearch, for this Koha-instance >+eg. koha-mykoha or just koha >+ > =item MISC_DIR > > Directory for for miscellaenous scripts, among other >@@ -488,6 +498,9 @@ my %config_defaults = ( > 'MEMCACHED_SERVERS' => '127.0.0.1:11211', > 'MEMCACHED_NAMESPACE' => 'KOHA', > 'TEMPLATE_CACHE_DIR' => '/tmp/koha', >+ 'USE_ELASTICSEARCH' => 'no', >+ 'ELASTICSEARCH_SERVERS' => 'localhost:9200', >+ 'ELASTICSEARCH_INDEX' => 'koha', > 'FONT_DIR' => '/usr/share/fonts/truetype/ttf-dejavu' > ); > >@@ -518,6 +531,7 @@ my %valid_config_values = ( > 'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 }, > 'RUN_DATABASE_TESTS' => { 'yes' => 1, 'no' => 1 }, > 'USE_MEMCACHED' => { 'yes' => 1, 'no' => 1 }, >+ 'USE_ELASTICSEARCH' => { 'yes' => 1, 'no' => 1 }, > ); > > # get settings from command-line >@@ -1199,6 +1213,29 @@ Memcached namespace?); > $config{'MEMCACHED_NAMESPACE'} = _get_value('MEMCACHED_NAMESPACE', $msg, $defaults->{'MEMCACHED_NAMESPACE'}, $valid_values, $install_log_values); > } > >+ >+ $msg = q( >+Use Elasticsearch to serve search results? >+You will need a Elasticsearch server running.); >+ $msg .= _add_valid_values_disp('USE_ELASTICSEARCH', $valid_values); >+ $config{'USE_ELASTICSEARCH'} = _get_value('USE_ELASTICSEARCH', $msg, $defaults->{'USE_ELASTICSEARCH'}, $valid_values, $install_log_values); >+ if ($config{'USE_ELASTICSEARCH'} eq 'yes'){ >+ $msg = q( >+Define the ELASTICSEARCH_SERVERS with a comma-separated list. Eg >+localhost:9200, 192.168.0.100:9200 >+); >+ $msg = q( >+Elasticsearch server addresses?); >+ $config{'ELASTICSEARCH_SERVERS'} = _get_value('ELASTICSEARCH_SERVERS', $msg, $defaults->{'ELASTICSEARCH_SERVERS'}, $valid_values, $install_log_values); >+ >+ $msg = q( >+What index name to use for this Koha-instance? It must be unique for each Koha >+sharing the same Elasticsearch-cluster >+ >+Elasticsearch index?); >+ $config{'ELASTICSEARCH_INDEX'} = _get_value('ELASTICSEARCH_INDEX', $msg, $defaults->{'ELASTICSEARCH_INDEX'}, $valid_values, $install_log_values); >+ } >+ > $msg = q( > Template cache directory?); > $config{'TEMPLATE_CACHE_DIR'} = _get_value('TEMPLATE_CACHE_DIR', $msg, $defaults->{'TEMPLATE_CACHE_DIR'}, $valid_values, $install_log_values); >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index e9e562439d..5173511e12 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -347,8 +347,8 @@ __END_SRU_PUBLICSERVER__ > > <!-- Elasticsearch Configuration --> > <elasticsearch> >- <server>localhost:9200</server> >- <index_name>koha___KOHASITE__</index_name> >+ <server>localhost:9200</server> <!-- may be repeated to include all servers on your cluster --> >+ <index_name>koha___KOHASITE__</index_name> <!-- should be unique amongst all the indices on your cluster. _biblios and _authorities will be appended. --> > </elasticsearch> > <!-- Uncomment the following line if you want to override the Elasticsearch default index settings --> > <!-- <elasticsearch_index_config>__KOHA_CONF_DIR__/searchengine/elasticsearch/index_config.yaml</elasticsearch_index_config> --> >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index fc7c7cfead..b10e95114d 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -163,8 +163,8 @@ __PAZPAR2_TOGGLE_XML_POST__ > > <!-- Elasticsearch Configuration --> > <elasticsearch> >- <server>localhost:9200</server> >- <index_name>koha___DB_NAME__</index_name> >+ <server>__ELASTICSEARCH_SERVERS__</server> >+ <index_name>__ELASTICSEARCH_INDEX_____DB_NAME__</index_name> > > <!-- See https://metacpan.org/pod/Search::Elasticsearch#cxn_pool --> > <cxn_pool>Static</cxn_pool> >diff --git a/rewrite-config.PL b/rewrite-config.PL >index 8b886847f3..1fec27c3d5 100644 >--- a/rewrite-config.PL >+++ b/rewrite-config.PL >@@ -150,6 +150,9 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr"; > "__USE_MEMCACHED__" => 'yes', > "__MEMCACHED_SERVERS__" => "", > "__MEMCACHED_NAMESPACE__" => "", >+ "__USE_ELASTICSEARCH__" => 'no', >+ "__ELASTICSEARCH_SERVERS__" => "localhost:9200", >+ "__ELASTICSEARCH_INDEX__" => "koha", > "__FONT_DIR__" => "/usr/share/fonts/truetype/ttf-dejavu", > "__TEMPLATE_CACHE_DIR__" => "/tmp/koha" > ); >-- >2.17.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 17851
:
58611
|
58956
|
91288
|
91289
|
93542
|
93543
|
93547
|
93548