Bug 26314: (follow-up) Use clean_search_term
This patch uses the now public clean_search_term from bug 28316 to sanitize the title string and prevent crashes in elastic search when title contain reserved characters. Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
cd0a374b93
commit
6e49a8be26
1 changed files with 3 additions and 0 deletions
|
@ -1692,6 +1692,8 @@ Returns a query which can be used to search for all component parts of MARC21 bi
|
|||
sub get_volumes_query {
|
||||
my ($self) = @_;
|
||||
|
||||
my $builder = Koha::SearchEngine::QueryBuilder->new(
|
||||
{ index => $Koha::SearchEngine::BIBLIOS_INDEX } );
|
||||
my $marc = $self->metadata->record;
|
||||
|
||||
my $searchstr;
|
||||
|
@ -1722,6 +1724,7 @@ sub get_volumes_query {
|
|||
else {
|
||||
my $cleaned_title = $marc->title;
|
||||
$cleaned_title =~ tr|/||;
|
||||
$cleaned_title = $builder->clean_search_term($cleaned_title);
|
||||
$searchstr = "ti,phr:($cleaned_title)";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue