fix to add wordlist default when QueryStemming is off
authorJoshua Ferraro <jmf@liblime.com>
Mon, 17 Dec 2007 15:28:13 +0000 (09:28 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 17 Dec 2007 18:00:18 +0000 (12:00 -0600)
also, a fix to default behavior when QueryWeighting is off

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Search.pm

index ce7d4ee..72121a8 100644 (file)
@@ -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) {