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

(-)a/Koha/SearchEngine/Elasticsearch.pm (-8 / +6 lines)
Lines 86-97 sub get_elasticsearch { Link Here
86
    my $self = shift @_;
86
    my $self = shift @_;
87
    unless (defined $self->{elasticsearch}) {
87
    unless (defined $self->{elasticsearch}) {
88
        my $conf = $self->get_elasticsearch_params();
88
        my $conf = $self->get_elasticsearch_params();
89
        $self->{elasticsearch} = Search::Elasticsearch->new(
89
        $self->{elasticsearch} = Search::Elasticsearch->new($conf);
90
            client => "5_0::Direct",
91
            nodes => $conf->{nodes},
92
            cxn_pool => 'Sniff',
93
            request_timeout => 60
94
        );
95
    }
90
    }
96
    return $self->{elasticsearch};
91
    return $self->{elasticsearch};
97
}
92
}
Lines 141-152 sub get_elasticsearch_params { Link Here
141
    else {
136
    else {
142
        die "No elasticsearch servers were specified in koha-conf.xml.\n";
137
        die "No elasticsearch servers were specified in koha-conf.xml.\n";
143
    }
138
    }
144
    die "No elasticserver index_name was specified in koha-conf.xml.\n"
139
    die "No elasticsearch index_name was specified in koha-conf.xml.\n"
145
      if ( !$es->{index_name} );
140
      if ( !$es->{index_name} );
146
    # Append the name of this particular index to our namespace
141
    # Append the name of this particular index to our namespace
147
    $es->{index_name} .= '_' . $self->index;
142
    $es->{index_name} .= '_' . $self->index;
148
143
149
    $es->{key_prefix} = 'es_';
144
    $es->{key_prefix} = 'es_';
145
    $es->{client} //= '5_0::Direct';
146
    $es->{cxn_pool} //= 'Sniff';
147
    $es->{request_timeout} //= 60;
148
150
    return $es;
149
    return $es;
151
}
150
}
152
151
153
- 

Return to bug 21974