fixes to scan
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
937bb38e6a
commit
01f9fd779a
12
C4/Search.pm
12
C4/Search.pm
|
|
@ -287,8 +287,8 @@ sub getRecords {
|
|||
$query_to_use = $simple_query;
|
||||
}
|
||||
|
||||
$query_to_use = $simple_query if $scan;
|
||||
|
||||
#$query_to_use = $simple_query if $scan;
|
||||
#warn $simple_query if ($scan && $DEBUG);
|
||||
# check if we've got a query_type defined
|
||||
eval {
|
||||
if ($query_type)
|
||||
|
|
@ -672,7 +672,7 @@ sub _build_weighted_query {
|
|||
|
||||
# build the query itself
|
||||
sub buildQuery {
|
||||
my ( $operators, $operands, $indexes, $limits, $sort_by ) = @_;
|
||||
my ( $operators, $operands, $indexes, $limits, $sort_by, $scan) = @_;
|
||||
|
||||
my @operators = @$operators if $operators;
|
||||
my @indexes = @$indexes if $indexes;
|
||||
|
|
@ -732,7 +732,7 @@ sub buildQuery {
|
|||
# a flag to determine whether or not to add the index to the query
|
||||
my $indexes_set;
|
||||
# if the user is sophisticated enough to specify an index, turn off some defaults
|
||||
if ($operands[$i] =~ /(:|=)/) {
|
||||
if ($operands[$i] =~ /(:|=)/ || $scan) {
|
||||
$weight_fields = 0;
|
||||
$stemming = 0;
|
||||
$remove_stopwords = 0;
|
||||
|
|
@ -876,6 +876,8 @@ sub buildQuery {
|
|||
$limit.="$availability_limit";
|
||||
}
|
||||
# normalize the strings
|
||||
$query =~ s/:/=/g;
|
||||
$limit =~ s/:/=/g;
|
||||
for ($query, $query_desc, $limit, $limit_desc) {
|
||||
$_ =~ s/ / /g; # remove extra spaces
|
||||
$_ =~ s/^ //g; # remove any beginning spaces
|
||||
|
|
@ -883,8 +885,6 @@ sub buildQuery {
|
|||
$_ =~ s/==/=/g; # remove double == from query
|
||||
|
||||
}
|
||||
$query =~ s/:/=/g;
|
||||
$limit =~ s/:/=/g;
|
||||
$query_cgi =~ s/^&//;
|
||||
|
||||
# append the limit to the query
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit
|
|||
my @results;
|
||||
|
||||
## I. BUILD THE QUERY
|
||||
( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by);
|
||||
( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by,$scan);
|
||||
|
||||
## parse the query_cgi string and put it into a form suitable for <input>s
|
||||
my @query_inputs;
|
||||
|
|
|
|||
Loading…
Reference in New Issue