[interchange-cvs] interchange - heins modified 3 files

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


User:      heins
Date:      2002-09-01 23:21:10 GMT
Modified:  lib/Vend Tag: STABLE_4_8-branch Glimpse.pm Search.pm
Modified:           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 reported by dst@vernet.gr (Dimitris Tsamitros).

Revision  Changes    Path
No                   revision



No                   revision



2.0.2.2   +13 -6     interchange/lib/Vend/Glimpse.pm


rev 2.0.2.2, prev_rev 2.0.2.1
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: /anon_cvs/repository/interchange/lib/Vend/Glimpse.pm,v
retrieving revision 2.0.2.1
retrieving revision 2.0.2.2
diff -u -r2.0.2.1 -r2.0.2.2
--- Glimpse.pm	24 Jan 2002 05:07:01 -0000	2.0.2.1
+++ Glimpse.pm	1 Sep 2002 23:21:07 -0000	2.0.2.2
@@ -1,6 +1,6 @@
 # Vend::Glimpse - Search indexes with Glimpse
 #
-# $Id: Glimpse.pm,v 2.0.2.1 2002/01/24 05:07:01 jon Exp $
+# $Id: Glimpse.pm,v 2.0.2.2 2002/09/01 23:21:07 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.0.2.1 $, 10);
+$VERSION =3D substr(q$Revision: 2.0.2.2 $, 10);
 use strict;
=20
 sub array {
@@ -130,14 +130,13 @@
 			undef $s->{mv_range_look};
 		}
 	}
-	@specs =3D @{$s->{mv_searchspec}};
-
-	@pats =3D $s->spec_check(@specs);
=20
 	return $s->search_error("Search with glimpse, no glimpse configured.")
 		if ! $s->{glimpse_cmd};
=20
-	return undef if $s->{matches} =3D=3D -1;
+	@specs =3D @{$s->{mv_searchspec}};
+
+	@pats =3D $s->spec_check(@specs);
=20
 	# Build glimpse line
 	my @cmd;
@@ -212,6 +211,14 @@
=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.0.2.3   +2 -10     interchange/lib/Vend/Search.pm


rev 2.0.2.3, prev_rev 2.0.2.2
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: /anon_cvs/repository/interchange/lib/Vend/Search.pm,v
retrieving revision 2.0.2.2
retrieving revision 2.0.2.3
diff -u -r2.0.2.2 -r2.0.2.3
--- Search.pm	6 Feb 2002 03:48:36 -0000	2.0.2.2
+++ Search.pm	1 Sep 2002 23:21:07 -0000	2.0.2.3
@@ -1,6 +1,6 @@
 # Vend::Search - Base class for search engines
 #
-# $Id: Search.pm,v 2.0.2.2 2002/02/06 03:48:36 mheins Exp $
+# $Id: Search.pm,v 2.0.2.3 2002/09/01 23:21:07 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.0.2.2 $, 10);
+$VERSION =3D substr(q$Revision: 2.0.2.3 $, 10);
=20
 use strict;
 use vars qw($VERSION);
@@ -238,14 +238,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.0.2.3   +2 -4      interchange/lib/Vend/TextSearch.pm


rev 2.0.2.3, prev_rev 2.0.2.2
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: /anon_cvs/repository/interchange/lib/Vend/TextSearch.pm,v
retrieving revision 2.0.2.2
retrieving revision 2.0.2.3
diff -u -r2.0.2.2 -r2.0.2.3
--- TextSearch.pm	22 Jun 2002 15:11:40 -0000	2.0.2.2
+++ TextSearch.pm	1 Sep 2002 23:21:07 -0000	2.0.2.3
@@ -1,6 +1,6 @@
 # Vend::TextSearch - Search indexes with Perl
 #
-# $Id: TextSearch.pm,v 2.0.2.2 2002/06/22 15:11:40 edl Exp $
+# $Id: TextSearch.pm,v 2.0.2.3 2002/09/01 23:21:07 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.0.2.2 $, 10);
+$VERSION =3D substr(q$Revision: 2.0.2.3 $, 10);
=20
 use Search::Dict;
 use strict;
@@ -151,8 +151,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;