use C4::Koha qw( getFacets GetVariationsOfISBN GetNormalizedUPC GetNormalizedEAN GetNormalizedOCLCNumber GetNormalizedISBN getitemtypeimagelocation );
use Koha::DateUtils;
use Koha::Libraries;
+use Koha::SearchEngine::QueryBuilder;
use Lingua::Stem;
use XML::Simple;
use C4::XSLT qw( XSLTParse4Display );
use Koha::Patrons;
use Koha::Recalls;
use Koha::RecordProcessor;
+use Koha::SearchFilters;
use URI::Escape;
use Business::ISBN;
use MARC::Record;
$limit .= "$this_limit";
$limit_desc .= " $this_limit";
} elsif ( $this_limit =~ '^search_filter:' ) {
+ # Here we will get the query as a string, append to the limits, and pass through buildQuery
+ # again to clean the terms and handle nested filters
$limit_cgi .= "&limit=" . uri_escape_utf8($this_limit);
my ($filter_id) = ( $this_limit =~ /^search_filter:(.*)$/ );
my $search_filter = Koha::SearchFilters->find( $filter_id );
next unless $search_filter;
- my $expanded = $search_filter->expand_filter;
- my ( $error, undef, undef, undef, undef, $fixed_limit, undef, undef, undef ) = buildQuery ( undef, undef, undef, $expanded, undef, undef, $lang);
+ my ($expanded_lim, $query_lim) = $search_filter->expand_filter;
+ push @$expanded_lim, $query_lim;
+ my ( $error, undef, undef, undef, undef, $fixed_limit, undef, undef, undef ) = buildQuery ( undef, undef, undef, $expanded_lim, undef, undef, $lang);
$limit .= " and " if $limit || $query;
$limit .= "$fixed_limit";
$limit_desc .= " $limit";
}
Koha::Logger->get->debug("QUERY BEFORE LIMITS: >$query<");
-
# Normalize the query and limit strings
# This is flawed , means we can't search anything with : in it
# if user wants to do ccl or cql, start the query with that
fix_amps => 1,
hidden_items => \@hiddenitems,
xslt_variables => $xslt_variables,
- interface => $search_context->{'interface'}
}
);
}