use Business::ISBN;
use MARC::Record;
use MARC::Field;
-
+use utf8;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
# set the version for version checking
$titleindex = 'title|exact';
$authorindex = 'author|exact';
$op = '&&';
+ $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
} else {
$titleindex = 'ti,ext';
$authorindex = 'au,ext';
my $QParser;
$QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') && ! ($query =~ m/\w,\w|\w=\w/));
+ if ($QParser) {
+ $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
+ }
# Initialize & Search Zebra
for ( my $i = 0 ; $i < @servers ; $i++ ) {
$weighted_query .= " $index,ext,r1=\"$operand\""; # exact index
#$weighted_query .= " or (title-sort-az=0 or $index,startswithnt,st-word,r3=$operand #)";
$weighted_query .= " or $index,phr,r3=\"$operand\""; # phrase index
- $weighted_query .=
- " or $index,rt,wrdl,r3=\"$operand\""; # word list index
+ $weighted_query .= " or $index,wrdl,r6=\"$operand\""; # word list index
+ $weighted_query .= " or $index,wrdl,fuzzy,r8=\"$operand\""
+ if $fuzzy_enabled; # add fuzzy, word list
+ $weighted_query .= " or $index,wrdl,rt,r9=\"$stemmed_operand\""
+ if ( $stemming and $stemmed_operand ); # add stemming, right truncation
}
$weighted_query .= "))"; # close rank specification
if ($QParser)
{
+ $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
$query = '';
for ( my $ii = 0 ; $ii <= @operands ; $ii++ ) {
next unless $operands[$ii];
$item_onhold_count++ if $reservestatus eq 'Waiting';
$item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
- # can place hold on item ?
- if ( !$item->{itemlost} ) {
- if ( !$item->{wthdrawn} ){
- if ( $item->{damaged} ){
- if ( C4::Context->preference('AllowHoldsOnDamagedItems') ){
- # can place a hold on a damaged item if AllowHoldsOnDamagedItems is true
- if ( ( !$item->{notforloan} || $item->{notforloan} < 0 ) ){
- # item is either for loan or has notforloan < 0
- $can_place_holds = 1;
- }
- }
- } elsif ( $item->{notforloan} < 0 ) {
- # item is not damaged and notforloan is < 0
- $can_place_holds = 1;
- }
- }
- }
+ # can place a hold on a item if
+ # not lost nor withdrawn
+ # not damaged unless AllowHoldsOnDamagedItems is true
+ # item is either for loan or on order (notforloan < 0)
+ $can_place_holds = 1
+ if (
+ !$item->{itemlost}
+ && !$item->{wthdrawn}
+ && ( !$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems') )
+ && ( !$item->{notforloan} || $item->{notforloan} < 0 )
+ );
$other_count++;