[interchange-cvs] interchange - edl modified 3 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Sat Jun 22 11:12:01 2002


User:      edl
Date:      2002-06-22 15:11:40 GMT
Modified:  lib/Vend Tag: STABLE_4_8-branch DbSearch.pm TextSearch.pm
Modified:           Scan.pm
Log:
Implementing mv_max_matches: if > 0, the search results will spliced at
its offset.

Revision  Changes    Path
No                   revision



No                   revision



2.0.2.9   +8 -3      interchange/lib/Vend/DbSearch.pm


rev 2.0.2.9, prev_rev 2.0.2.8
Index: DbSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/DbSearch.pm,v
retrieving revision 2.0.2.8
retrieving revision 2.0.2.9
diff -u -r2.0.2.8 -r2.0.2.9
--- DbSearch.pm	24 Jan 2002 05:07:01 -0000	2.0.2.8
+++ DbSearch.pm	22 Jun 2002 15:11:40 -0000	2.0.2.9
@@ -1,6 +1,6 @@
 # Vend::DbSearch - Search indexes with Interchange
 #
-# $Id: DbSearch.pm,v 2.0.2.8 2002/01/24 05:07:01 jon Exp $
+# $Id: DbSearch.pm,v 2.0.2.9 2002/06/22 15:11:40 edl Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -26,7 +26,7 @@
 
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 2.0.2.8 $, 10);
+$VERSION = substr(q$Revision: 2.0.2.9 $, 10);
 
 use Search::Dict;
 use strict;
@@ -303,8 +303,13 @@
 	if($s->{mv_unique}) {
 		my %seen;
 		@out = grep ! $seen{$_->[0]}++, @out;
-		$s->{matches} = scalar(@out);
 	}
+
+	if($s->{mv_max_matches} > 0) {
+		splice @out, $s->{mv_max_matches};
+	}
+
+	$s->{matches} = scalar(@out);
 
 	if ($s->{matches} > $s->{mv_matchlimit}) {
 		$s->save_more(\@out)



2.0.2.2   +8 -3      interchange/lib/Vend/TextSearch.pm


rev 2.0.2.2, prev_rev 2.0.2.1
Index: TextSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/TextSearch.pm,v
retrieving revision 2.0.2.1
retrieving revision 2.0.2.2
diff -u -r2.0.2.1 -r2.0.2.2
--- TextSearch.pm	24 Jan 2002 05:07:02 -0000	2.0.2.1
+++ TextSearch.pm	22 Jun 2002 15:11:40 -0000	2.0.2.2
@@ -1,6 +1,6 @@
 # Vend::TextSearch - Search indexes with Perl
 #
-# $Id: TextSearch.pm,v 2.0.2.1 2002/01/24 05:07:02 jon Exp $
+# $Id: TextSearch.pm,v 2.0.2.2 2002/06/22 15:11:40 edl Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -28,7 +28,7 @@
 use vars qw(@ISA);
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 2.0.2.1 $, 10);
+$VERSION = substr(q$Revision: 2.0.2.2 $, 10);
 
 use Search::Dict;
 use strict;
@@ -332,8 +332,13 @@
 	if($s->{mv_unique}) {
 		my %seen;
 		@out = grep ! $seen{$_->[0]}++, @out;
-		$s->{matches} = scalar(@out);
 	}
+
+	if($s->{mv_max_matches} > 0) {
+		splice @out, $s->{mv_max_matches};
+	}
+
+	$s->{matches} = scalar(@out);
 
 	if ($s->{matches} > $s->{mv_matchlimit}) {
 		$s->save_more(\@out)



2.0.2.5   +3 -3      interchange/lib/Vend/Scan.pm


rev 2.0.2.5, prev_rev 2.0.2.4
Index: Scan.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Scan.pm,v
retrieving revision 2.0.2.4
retrieving revision 2.0.2.5
diff -u -r2.0.2.4 -r2.0.2.5
--- Scan.pm	1 Mar 2002 20:10:53 -0000	2.0.2.4
+++ Scan.pm	22 Jun 2002 15:11:40 -0000	2.0.2.5
@@ -1,6 +1,6 @@
 # Vend::Scan - Prepare searches for Interchange
 #
-# $Id: Scan.pm,v 2.0.2.4 2002/03/01 20:10:53 racke Exp $
+# $Id: Scan.pm,v 2.0.2.5 2002/06/22 15:11:40 edl Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -29,7 +29,7 @@
 			perform_search
 			);
 
-$VERSION = substr(q$Revision: 2.0.2.4 $, 10);
+$VERSION = substr(q$Revision: 2.0.2.5 $, 10);
 
 use strict;
 use Vend::Util;
@@ -196,7 +196,7 @@
 	mv_exact_match          =>  \&_yes,
 	mv_head_skip            =>  \&_number,
 	mv_matchlimit           =>  sub { $_[1] =~ /(\d+)/ ? $1 : 50 },
-	mv_max_matches          =>  sub { $_[1] =~ /(\d+)/ ? $1 : 2000 },
+	mv_max_matches          =>  sub { $_[1] =~ /(\d+)/ ? $1 : -1 },
 	mv_min_string           =>  sub { $_[1] =~ /(\d+)/ ? $1 : 1 },
 	mv_profile              =>  \&parse_profile,
 	mv_range_alpha          =>  \&_array,