View | Details | Raw Unified | Return to bug 26310
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch.pm (+2 lines)
Lines 1253-1258 sub _read_configuration { Link Here
1253
1253
1254
    $configuration->{cxn_pool} = $conf->{cxn_pool} // 'Static';
1254
    $configuration->{cxn_pool} = $conf->{cxn_pool} // 'Static';
1255
1255
1256
    $configuration->{trace_to} = $conf->{trace_to} if defined $conf->{trace_to};
1257
1256
    return $configuration;
1258
    return $configuration;
1257
}
1259
}
1258
1260
(-)a/etc/koha-conf.xml (+2 lines)
Lines 178-183 __PAZPAR2_TOGGLE_XML_POST__ Link Here
178
178
179
     <!-- See https://metacpan.org/pod/Search::Elasticsearch#cxn_pool -->
179
     <!-- See https://metacpan.org/pod/Search::Elasticsearch#cxn_pool -->
180
     <cxn_pool>Static</cxn_pool>
180
     <cxn_pool>Static</cxn_pool>
181
     <!-- See https://metacpan.org/pod/Search::Elasticsearch#trace_to -->
182
     <!-- <trace_to>Stderr</trace_to> -->
181
 </elasticsearch>
183
 </elasticsearch>
182
 <!-- Uncomment the following line if you want to override the Elasticsearch default index settings -->
184
 <!-- Uncomment the following line if you want to override the Elasticsearch default index settings -->
183
 <!-- <elasticsearch_index_config>__KOHA_CONF_DIR__/searchengine/elasticsearch/index_config.yaml</elasticsearch_index_config> -->
185
 <!-- <elasticsearch_index_config>__KOHA_CONF_DIR__/searchengine/elasticsearch/index_config.yaml</elasticsearch_index_config> -->
(-)a/t/Koha/SearchEngine/Elasticsearch.t (-2 / +6 lines)
Lines 33-39 use Koha::SearchEngine::Elasticsearch::Search; Link Here
33
33
34
subtest '_read_configuration() tests' => sub {
34
subtest '_read_configuration() tests' => sub {
35
35
36
    plan tests => 13;
36
    plan tests => 15;
37
37
38
    my $configuration;
38
    my $configuration;
39
    t::lib::Mocks::mock_config( 'elasticsearch', undef );
39
    t::lib::Mocks::mock_config( 'elasticsearch', undef );
Lines 96-105 subtest '_read_configuration() tests' => sub { Link Here
96
96
97
    $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration;
97
    $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration;
98
    is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' );
98
    is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' );
99
    isnt( defined $configuration->{trace_to}, 'trace_to is not defined if not set' );
99
100
100
    my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params;
101
    my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params;
101
    is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' );
102
    is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' );
102
103
104
    t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Fluid', trace_to => 'Stderr' } );
105
106
    $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration;
107
    is( $configuration->{trace_to}, 'Stderr', 'trace_to configuration parsed correctly' );
103
};
108
};
104
109
105
subtest 'get_elasticsearch_settings() tests' => sub {
110
subtest 'get_elasticsearch_settings() tests' => sub {
106
- 

Return to bug 26310