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

(-)a/Koha/SearchEngine/Elasticsearch.pm (+2 lines)
Lines 1282-1287 sub _read_configuration { Link Here
1282
1282
1283
    $configuration->{cxn_pool} = $conf->{cxn_pool} // 'Static';
1283
    $configuration->{cxn_pool} = $conf->{cxn_pool} // 'Static';
1284
1284
1285
    $configuration->{trace_to} = $conf->{trace_to} if defined $conf->{trace_to};
1286
1285
    return $configuration;
1287
    return $configuration;
1286
}
1288
}
1287
1289
(-)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/db_dependent/Koha/SearchEngine/Elasticsearch.t (-2 / +6 lines)
Lines 37-43 $schema->storage->txn_begin; Link Here
37
37
38
subtest '_read_configuration() tests' => sub {
38
subtest '_read_configuration() tests' => sub {
39
39
40
    plan tests => 13;
40
    plan tests => 15;
41
41
42
    my $configuration;
42
    my $configuration;
43
    t::lib::Mocks::mock_config( 'elasticsearch', undef );
43
    t::lib::Mocks::mock_config( 'elasticsearch', undef );
Lines 100-109 subtest '_read_configuration() tests' => sub { Link Here
100
100
101
    $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration;
101
    $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration;
102
    is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' );
102
    is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' );
103
    isnt( defined $configuration->{trace_to}, 'trace_to is not defined if not set' );
103
104
104
    my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params;
105
    my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params;
105
    is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' );
106
    is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' );
106
107
108
    t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Fluid', trace_to => 'Stderr' } );
109
110
    $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration;
111
    is( $configuration->{trace_to}, 'Stderr', 'trace_to configuration parsed correctly' );
107
};
112
};
108
113
109
subtest 'get_elasticsearch_settings() tests' => sub {
114
subtest 'get_elasticsearch_settings() tests' => sub {
110
- 

Return to bug 26310