[interchange-cvs] interchange - edl modified 3 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Sat Jun 22 18:31:01 2002


User:      edl
Date:      2002-06-22 22:30:22 GMT
Modified:  lib/Vend DbSearch.pm TextSearch.pm Scan.pm
Log:
Implementing mv_max_matches as done in stable branch earlier today.

Revision  Changes    Path
2.11      +8 -4      interchange/lib/Vend/DbSearch.pm


rev 2.11, prev_rev 2.10
Index: DbSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/DbSearch.pm,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -r2.10 -r2.11
--- DbSearch.pm	17 Jun 2002 22:24:07 -0000	2.10
+++ DbSearch.pm	22 Jun 2002 22:30:22 -0000	2.11
@@ -1,6 +1,6 @@
 # Vend::DbSearch - Search indexes with Interchange
 #
-# $Id: DbSearch.pm,v 2.10 2002/06/17 22:24:07 jon Exp $
+# $Id: DbSearch.pm,v 2.11 2002/06/22 22:30:22 edl Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -26,7 +26,7 @@
 
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 2.10 $, 10);
+$VERSION = substr(q$Revision: 2.11 $, 10);
 
 use Search::Dict;
 use strict;
@@ -297,7 +297,6 @@
 #::logDebug("did next_search: " . ::uneval(\@out));
 	}
 
-	$s->{matches} = scalar(@out);
 #::logDebug("before delayed return: self=" . ::Vend::Util::uneval_it({%$s}));
 
 	if($delayed_return and $s->{matches} > 0) {
@@ -311,8 +310,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.7       +8 -5      interchange/lib/Vend/TextSearch.pm


rev 2.7, prev_rev 2.6
Index: TextSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/TextSearch.pm,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -r2.6 -r2.7
--- TextSearch.pm	17 Jun 2002 22:24:08 -0000	2.6
+++ TextSearch.pm	22 Jun 2002 22:30:22 -0000	2.7
@@ -1,6 +1,6 @@
 # Vend::TextSearch - Search indexes with Perl
 #
-# $Id: TextSearch.pm,v 2.6 2002/06/17 22:24:08 jon Exp $
+# $Id: TextSearch.pm,v 2.7 2002/06/22 22:30:22 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.6 $, 10);
+$VERSION = substr(q$Revision: 2.7 $, 10);
 
 use Search::Dict;
 use strict;
@@ -322,8 +322,6 @@
 #::logDebug("did next_search: " . ::uneval(\@out));
 	}
 
-	$s->{matches} = scalar(@out);
-
 	if($delayed_return and $s->{matches} > 0) {
 		$s->hash_fields($s->{mv_field_names}, qw/mv_sort_field/);
 #::logDebug("after hash fields: self=" . ::Vend::Util::uneval_it({%$s}));
@@ -337,8 +335,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.10      +3 -3      interchange/lib/Vend/Scan.pm


rev 2.10, prev_rev 2.9
Index: Scan.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Scan.pm,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -r2.9 -r2.10
--- Scan.pm	17 Jun 2002 22:24:08 -0000	2.9
+++ Scan.pm	22 Jun 2002 22:30:22 -0000	2.10
@@ -1,6 +1,6 @@
 # Vend::Scan - Prepare searches for Interchange
 #
-# $Id: Scan.pm,v 2.9 2002/06/17 22:24:08 jon Exp $
+# $Id: Scan.pm,v 2.10 2002/06/22 22:30:22 edl Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -29,7 +29,7 @@
 			perform_search
 			);
 
-$VERSION = substr(q$Revision: 2.9 $, 10);
+$VERSION = substr(q$Revision: 2.10 $, 10);
 
 use strict;
 use Vend::Util;
@@ -202,7 +202,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,