[interchange-cvs] interchange - heins modified lib/Vend/Search.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Sun Jun 6 23:09:37 EDT 2004
User: heins
Date: 2004-06-07 03:09:36 GMT
Modified: lib/Vend Search.pm
Log:
* Text::Query's advanced mode could not find words with single quotes,
and in fact will throw an error.
This is a workaround that breaks it into a "word AND word" search.
Revision Changes Path
2.23 +5 -2 interchange/lib/Vend/Search.pm
rev 2.23, prev_rev 2.22
Index: Search.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Search.pm,v
retrieving revision 2.22
retrieving revision 2.23
diff -u -r2.22 -r2.23
--- Search.pm 8 Apr 2004 15:05:09 -0000 2.22
+++ Search.pm 7 Jun 2004 03:09:36 -0000 2.23
@@ -1,6 +1,6 @@
# Vend::Search - Base class for search engines
#
-# $Id: Search.pm,v 2.22 2004/04/08 15:05:09 mheins Exp $
+# $Id: Search.pm,v 2.23 2004/06/07 03:09:36 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -22,7 +22,7 @@
package Vend::Search;
-$VERSION = substr(q$Revision: 2.22 $, 10);
+$VERSION = substr(q$Revision: 2.23 $, 10);
use strict;
use vars qw($VERSION);
@@ -521,6 +521,9 @@
? $s->{mv_substring_match}[$i]
: $s->{mv_substring_match};
+ $string =~ s/(\w)'(s)\b/$1$2/g;
+ $string =~ s/(\w)'(\w+)/$1 and $2/g;
+ $string =~ s/'//g;
#::logDebug("query creation called, op=$op cs=$cs ac=$ac");
if($op eq 'aq') {
$q = new Text::Query($string,
More information about the interchange-cvs
mailing list