[Koha-cvs] koha/C4 Search.pm [dev_week]
Joshua Ferraro
jmf at kados.org
Mon Oct 9 16:56:30 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Joshua Ferraro <kados> 06/10/09 14:56:30
Modified files:
C4 : Search.pm
Log message:
homebranch wasn't being displayed properly
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.99.2.11.2.30&r2=1.99.2.11.2.31
Patches:
Index: Search.pm
===================================================================
RCS file: /sources/koha/koha/C4/Search.pm,v
retrieving revision 1.99.2.11.2.30
retrieving revision 1.99.2.11.2.31
diff -u -b -r1.99.2.11.2.30 -r1.99.2.11.2.31
--- Search.pm 8 Oct 2006 21:19:38 -0000 1.99.2.11.2.30
+++ Search.pm 9 Oct 2006 14:56:30 -0000 1.99.2.11.2.31
@@ -39,7 +39,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.99.2.11.2.30 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.99.2.11.2.31 $' =~ /\d+/g;
shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
=head1 NAME
@@ -1285,7 +1285,7 @@
$sthnflstatus->execute;
my ($authorised_valuecode) = $sthnflstatus->fetchrow;
if ($authorised_valuecode) {
- warn "authorised valuecode: $authorised_valuecode";
+ #warn "authorised valuecode: $authorised_valuecode";
$sthnflstatus = $dbh->prepare("select lib from authorised_values where category=? and authorised_value=?");
$sthnflstatus->execute($authorised_valuecode,$data->{notforloan});
my ($lib) = $sthnflstatus->fetchrow;
@@ -3099,13 +3099,13 @@
$weighted_query .= " $operand";
}
else {
- $weighted_query .= " Title-cover,ext,r1=$operand"; # index label as exact
+ $weighted_query .= " Title-cover,ext,r1=\"$operand\""; # index label as exact
$weighted_query .= " or ti,ext,r2=$operand"; # index as exact
#$weighted_query .= " or ti,phr,r3=$operand"; # index as phrase
#$weighted_query .= " or any,ext,r4=$operand"; # index as exact
$weighted_query .= " or kw,wrdl,r5=$operand"; # index as exact
$weighted_query .= " or wrd,fuzzy,r9=$operand";
- $weighted_query .= " or wrd=$stemmed_operand" if $stemming;
+ #$weighted_query .= " or wrd=$stemmed_operand" if $stemming;
}
}
elsif ($index =~ /au/) {
@@ -3118,8 +3118,11 @@
elsif ($index =~ /ti/) {
$weighted_query .= " Title-cover,ext,r1=$operand"; # index label as exact
$weighted_query .= " or Title-series,ext,r2=$operand";
+ #$weighted_query .= " or ti,ext,r2=$operand";
+ #$weighted_query .= " or ti,phr,r3=$operand";
+ #$weighted_query .= " or ti,wrd,r3=$operand";
$weighted_query .= " or (title-sort-az=0 or Title-cover,startswithnt,st-word,r3=$operand #)";
- #$weighted_query .= " or (title-sort-az=0 or Title-cover,phr,r4=$operand)";
+ $weighted_query .= " or (title-sort-az=0 or Title-cover,phr,r6=$operand)";
#$weighted_query .= " or Title-cover,wrd,r5=$operand";
#$weighted_query .= " or ti,ext,r6=$operand";
#$weighted_query .= " or ti,startswith,phr,r7=$operand";
@@ -3176,10 +3179,12 @@
# add limits
my $limit_query;
my $limit_search_desc;
+
+ # FIXME: should write up some documentation about the design goals here
foreach my $limit (@limits) {
# FIXME: not quite right yet ... will work on this soon -- JF
if ($limit =~ /available/) {
- $limit_query.=" and (($query and datedue=0000-00-00) or ($query and datedue=0000-00-00 not lost=1) or ($query and datedue=0000-00-00 not lost=2))";
+ $limit_query.=" (($query and datedue=0000-00-00) or ($query and datedue=0000-00-00 not lost=1) or ($query and datedue=0000-00-00 not lost=2))";
#$limit_search_desc.=" and available";
}
# these queries are treated as OR
@@ -3202,7 +3207,7 @@
# if there's also a query, we need to AND the limits to it
if (($limit_query) && ($query)) {
$limit_query=" and (".$limit_query.")";
- $limit_search_desc=" and ($limit_search_desc)";
+ $limit_search_desc=" and ($limit_search_desc)" if $limit_search_desc;
}
$query .= $limit_query;
@@ -3335,7 +3340,7 @@
else {
$norequests = 0;
if ($item->{'homebranch'}) {
- $items->{$item->{'holdingbranch'}}->{count}++;
+ $items->{$item->{'homebranch'}}->{count}++;
}
# Last resort
elsif ($item->{'holdingbranch'}) {
More information about the Koha-cvs
mailing list