Perlfect Solutions
 

[Perlfect-search] Re: backwards?

Rob Stevenson rstevenson@accesscable.net
Fri, 15 Dec 2000 13:53:27 -0400
Hi again Daniel et al,

I copied each line separately this time and the script now works. But it 
produces exactly the same results as it did before I inserted the extra 
lines.

That is, in my search.pl v1.5, in sub create_query I now have...

  foreach my $term (@terms) {
    $buffer = normalize($term);
    foreach my $nterm (split " ",$buffer) {
      $sterm = stem($nterm);
      # For "Match all words" just add a "+" to every term that has no 
operator:
      if ( $query->param('mode') eq 'all' && $term !~ m/^(\+|\-)/) {
         $term = '+'.$term;
      }
     ....

(The last 3 lines, after the comment, is the added bit.) So this should 
be adding a + sign in front of every search term to create a default AND. 
But prior to this change a search on 3 terms returned 376 matches and 
after it I still get 376 matches. But if I manually type a + sign in 
front of each term I get 108 matches.

Do I need to add anything more?

Rob

------------------
on 15/12/00 11:08 Daniel Naber said...

>> I have 3.09 installed on the server, and it includes search.pl v1.5, but
>> the page of changes you suggested (2nd URL below) was for the diffs
>> between 1.14 and 1.15. When I apply them I get a error about an
>> incorrect character.
>
>You'll have to apply them by hand, i.e. copy those few lines that are 
>relevant (the comment says it's about "+" to emulate AND).


---------------------------------
Rob Stevenson - CIMI web manager
email: web@cimi.org
---------------------------------