[interchange-cvs] interchange - heins modified 3 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sun Sep 1 19:21:01 2002


User:      heins
Date:      2002-09-01 23:19:53 GMT
Modified:  lib/Vend Glimpse.pm Search.pm TextSearch.pm
Log:
* Remove min_string test from Search.pm, where it never really was used
  or called due to mv_min_string default being 0.

* Place mv_min_string check back in Glimpse where it was intended in the fi=
rst
  place.

* Resolves Bugzilla #255.

Revision  Changes    Path
2.7       +15 -5     interchange/lib/Vend/Glimpse.pm


rev 2.7, prev_rev 2.6
Index: Glimpse.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Glimpse.pm,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -r2.6 -r2.7
--- Glimpse.pm	15 Jul 2002 13:41:12 -0000	2.6
+++ Glimpse.pm	1 Sep 2002 23:19:51 -0000	2.7
@@ -1,6 +1,6 @@
 # Vend::Glimpse - Search indexes with Glimpse
 #
-# $Id: Glimpse.pm,v 2.6 2002/07/15 13:41:12 mheins Exp $
+# $Id: Glimpse.pm,v 2.7 2002/09/01 23:19:51 mheins Exp $
 #
 # Adapted for use with Interchange from Search::Glimpse
 #
@@ -25,7 +25,7 @@
 require Vend::Search;
 @ISA =3D qw(Vend::Search);
=20
-$VERSION =3D substr(q$Revision: 2.6 $, 10);
+$VERSION =3D substr(q$Revision: 2.7 $, 10);
 use strict;
=20
 sub array {
@@ -122,13 +122,13 @@
 	$s->{mv_return_delim} =3D $s->{mv_index_delim}
 		unless defined $s->{mv_return_delim};
=20
+	return $s->search_error("Search with glimpse, no glimpse configured.")
+		if ! $s->{glimpse_cmd};
+
 	@specs =3D @{$s->{mv_searchspec}};
=20
 	@pats =3D $s->spec_check(@specs);
=20
-	return $s->search_error("Search with glimpse, no glimpse configured.")
-		if ! $s->{glimpse_cmd};
-
 	return undef if $s->{matches} =3D=3D -1;
=20
 	# Build glimpse line
@@ -204,6 +204,16 @@
=20=09
 	my $spec =3D join $joiner, @pats;
 	$spec =3D~ s/'/./g;
+
+	if(length($spec) < $s->{mv_min_string}) {
+		my $msg =3D errmsg(
+					"Glimpse search string less than minimum %s characters: %s",
+					$s->{mv_min_string},
+					$spec,
+				);
+		return $s->search_error($msg);
+	}
+
 	push @cmd, "'$spec'";
=20
 	$joiner =3D $spec;



2.11      +2 -10     interchange/lib/Vend/Search.pm


rev 2.11, prev_rev 2.10
Index: Search.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Search.pm,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -r2.10 -r2.11
--- Search.pm	11 Aug 2002 15:52:30 -0000	2.10
+++ Search.pm	1 Sep 2002 23:19:51 -0000	2.11
@@ -1,6 +1,6 @@
 # Vend::Search - Base class for search engines
 #
-# $Id: Search.pm,v 2.10 2002/08/11 15:52:30 mheins Exp $
+# $Id: Search.pm,v 2.11 2002/09/01 23:19:51 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -21,7 +21,7 @@
=20
 package Vend::Search;
=20
-$VERSION =3D substr(q$Revision: 2.10 $, 10);
+$VERSION =3D substr(q$Revision: 2.11 $, 10);
=20
 use strict;
 use vars qw($VERSION);
@@ -257,14 +257,6 @@
 		    splice(@specs, $i, 1);
 		}
 		else {
-			if(length($specs[$i]) < $s->{mv_min_string}) {
-				my $msg =3D <<EOF;
-Search strings must be at least $s->{mv_min_string} characters.
-You had '$specs[$i]' as one of your search strings.
-EOF
-				$s->{matches} =3D -1;
-				return undef;
-			}
 			COLOP: {
 				last COLOP unless $s->{mv_coordinate};
 #::logDebug("i=3D$i, begin_string=3D$s->{mv_begin_string}[$i]");



2.11      +2 -4      interchange/lib/Vend/TextSearch.pm


rev 2.11, prev_rev 2.10
Index: TextSearch.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/TextSearch.pm,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -r2.10 -r2.11
--- TextSearch.pm	15 Jul 2002 13:41:12 -0000	2.10
+++ TextSearch.pm	1 Sep 2002 23:19:51 -0000	2.11
@@ -1,6 +1,6 @@
 # Vend::TextSearch - Search indexes with Perl
 #
-# $Id: TextSearch.pm,v 2.10 2002/07/15 13:41:12 mheins Exp $
+# $Id: TextSearch.pm,v 2.11 2002/09/01 23:19:51 mheins Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -28,7 +28,7 @@
 use vars qw(@ISA);
 @ISA =3D qw(Vend::Search);
=20
-$VERSION =3D substr(q$Revision: 2.10 $, 10);
+$VERSION =3D substr(q$Revision: 2.11 $, 10);
=20
 use Search::Dict;
 use strict;
@@ -143,8 +143,6 @@
 	@specs =3D @{$s->{mv_searchspec}};
=20
 	@pats =3D $s->spec_check(@specs);
-
-	return undef if $s->{matches} =3D=3D -1;
=20
 	if ($s->{mv_coordinate}) {
 		undef $f;