From bbe759bde6f9e5bd9567e63a9cb021e9def1a8ec Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Mon, 17 Dec 2007 09:28:13 -0600 Subject: [PATCH] fix to add wordlist default when QueryStemming is off also, a fix to default behavior when QueryWeighting is off Signed-off-by: Joshua Ferraro --- C4/Search.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index ce7d4eeb9e..72121a8036 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -662,6 +662,8 @@ sub _build_weighted_query { #$weighted_query .=" or kw,wrdl,r5=\"$operand\""; # word list any $weighted_query .= " or wrd,fuzzy,r8=\"$operand\"" if $fuzzy_enabled; # add fuzzy, word list $weighted_query .= " or wrd,right-Truncation,r9=\"$stemmed_operand\"" if ($stemming and $stemmed_operand); # add stemming, right truncation + $weighted_query .= " or wrd,r9=\"$operand\""; + # embedded sorting: 0 a-z; 1 z-a # $weighted_query .= ") or (sort1,aut=1"; } @@ -759,10 +761,15 @@ sub buildQuery { } my $operand = $operands[$i]; my $index = $indexes[$i]; - + $DEBUG=1; # some helpful index modifs - my $index_plus = "$index:" if $index; - my $index_plus_comma="$index," if $index; + + my $wrdl; + unless (!$index || $index =~ /(phr|ext)/) { + $wrdl = ",wrdl"; + } + my $index_plus = $index.$wrdl.":" if $index; + my $index_plus_comma=$index.$wrdl."," if $index; # Remove Stopwords if ($remove_stopwords) { -- 2.39.2