Bug 12478: fix wrong counts/results for authority searches
authorRobin Sheat <robin@catalyst.net.nz>
Tue, 31 Mar 2015 04:26:49 +0000 (17:26 +1300)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 26 Apr 2016 20:20:06 +0000 (20:20 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm

index 62d0814..f7c2ba2 100644 (file)
@@ -260,7 +260,6 @@ The search description is a hashref that looks something like:
 sub build_authorities_query {
     my ($self, $search) = @_;
 
-warn "Search is " . Dumper $search;
     # Start by making the query parts
     my @query_parts;
     my @filter_parts;
@@ -637,6 +636,9 @@ sub _clean_search_term {
 
     $term = $self->_convert_index_strings_freeform($term);
     $term =~ s/[{}]/"/g;
+    # Some hardcoded searches (like with authorities) produce things like
+    # 'an=123', when it ought to be 'an:123'.
+    $term =~ s/=/:/g;
     return $term;
 }