[interchange-cvs] interchange - edl modified lib/Vend/RefSearch.pm

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


User:      edl
Date:      2002-06-23 02:57:57 GMT
Modified:  lib/Vend RefSearch.pm
Log:
Added handling for mv_max_matches.

Revision  Changes    Path
2.4       +8 -3      interchange/lib/Vend/RefSearch.pm


rev 2.4, prev_rev 2.3
Index: RefSearch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/RefSearch.pm,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- RefSearch.pm	23 Jun 2002 01:20:10 -0000	2.3
+++ RefSearch.pm	23 Jun 2002 02:57:57 -0000	2.4
@@ -1,6 +1,6 @@
 # Vend::DbSearch - Search indexes with Interchange
 #
-# $Id: RefSearch.pm,v 2.3 2002/06/23 01:20:10 jon Exp $
+# $Id: RefSearch.pm,v 2.4 2002/06/23 02:57:57 edl Exp $
 #
 # Adapted for use with Interchange from Search::TextSearch
 #
@@ -26,7 +26,7 @@
 
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 2.3 $, 10);
+$VERSION = substr(q$Revision: 2.4 $, 10);
 
 use strict;
 
@@ -251,8 +251,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);
 
 	## This is the normal return point unless RefSearch called by program
 	## or ITL