Bugzilla – Attachment 83291 Details for
Bug 21974
cxn_pool must be configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21974: Make Elasticsearch connection settings configurable
Bug-21974-Make-Elasticsearch-connection-settings-c.patch (text/plain), 2.08 KB, created by
Ere Maijala
on 2018-12-17 14:25:49 UTC
(
hide
)
Description:
Bug 21974: Make Elasticsearch connection settings configurable
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2018-12-17 14:25:49 UTC
Size:
2.08 KB
patch
obsolete
>From d101786905ea9f6a66ae7086dba31f48ec0d6a15 Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Mon, 17 Dec 2018 16:22:58 +0200 >Subject: [PATCH] Bug 21974: Make Elasticsearch connection settings > configurable > >Default settings are appended in get_elasticsearch_params so that there's a central place for them. Defaults can be overridden in koha-conf.xml. > >Test plan: > >1. Verify that searches still work with the patch applied. >2. Verify that search fails after adding the following under <elasticsearch> in koha-conf.xml: ><cxn_pool>Static</cxn_pool> >3. Verify that search fails after adding the following under <elasticsearch> in koha-conf.xml: ><cxn_pool>FOO</cxn_pool> >--- > Koha/SearchEngine/Elasticsearch.pm | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index d51c11e351..7e01ed8200 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -86,12 +86,7 @@ sub get_elasticsearch { > my $self = shift @_; > unless (defined $self->{elasticsearch}) { > my $conf = $self->get_elasticsearch_params(); >- $self->{elasticsearch} = Search::Elasticsearch->new( >- client => "5_0::Direct", >- nodes => $conf->{nodes}, >- cxn_pool => 'Sniff', >- request_timeout => 60 >- ); >+ $self->{elasticsearch} = Search::Elasticsearch->new($conf); > } > return $self->{elasticsearch}; > } >@@ -141,12 +136,16 @@ sub get_elasticsearch_params { > else { > die "No elasticsearch servers were specified in koha-conf.xml.\n"; > } >- die "No elasticserver index_name was specified in koha-conf.xml.\n" >+ die "No elasticsearch index_name was specified in koha-conf.xml.\n" > if ( !$es->{index_name} ); > # Append the name of this particular index to our namespace > $es->{index_name} .= '_' . $self->index; > > $es->{key_prefix} = 'es_'; >+ $es->{client} //= '5_0::Direct'; >+ $es->{cxn_pool} //= 'Sniff'; >+ $es->{request_timeout} //= 60; >+ > return $es; > } > >-- >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 21974
:
83291
|
86052
|
87006