[interchange-cvs] interchange - docelic modified 3 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Mon Jul 7 18:15:07 UTC 2008
User: docelic
Date: 2008-07-07 18:15:07 GMT
Modified: . WHATSNEW-5.7
Modified: lib/Vend Search.pm Scan.pm
Log:
* mv_force_coordinate as discussed on
http://www.icdevgroup.org/pipermail/interchange-users/2008-July/049222.html
Revision Changes Path
2.3 interchange/WHATSNEW-5.7
rev 2.3, prev_rev 2.2
Index: WHATSNEW-5.7
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.7,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- WHATSNEW-5.7 15 Jun 2008 19:11:16 -0000 2.2
+++ WHATSNEW-5.7 7 Jul 2008 18:15:07 -0000 2.3
@@ -10,6 +10,16 @@
Interchange 5.7.0 under development.
+Search
+------
+
+* mv_force_coordinate (fc) added to force coordinated search. Normally, when
+the number of search field does not match the number of search strings (specs),
+coordinated mode is automatically turned off. With 'fc', number of search specs
+is adjusted to match the number of search fields, either by filling the array
+with last-set mv_searchspec, or by trimming excess values. Useful when you want
+to search for one string in multiple fields in coordinated mode.
+
UserTag
-------
2.38 interchange/lib/Vend/Search.pm
rev 2.38, prev_rev 2.37
Index: Search.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Search.pm,v
retrieving revision 2.37
retrieving revision 2.38
diff -u -r2.37 -r2.38
--- Search.pm 29 Jan 2008 10:31:11 -0000 2.37
+++ Search.pm 7 Jul 2008 18:15:07 -0000 2.38
@@ -1,6 +1,6 @@
# Vend::Search - Base class for search engines
#
-# $Id: Search.pm,v 2.37 2008-01-29 10:31:11 racke Exp $
+# $Id: Search.pm,v 2.38 2008-07-07 18:15:07 docelic Exp $
#
# Copyright (C) 2002-2008 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -22,7 +22,7 @@
package Vend::Search;
-$VERSION = substr(q$Revision: 2.37 $, 10);
+$VERSION = substr(q$Revision: 2.38 $, 10);
use strict;
no warnings qw(uninitialized numeric);
@@ -240,8 +240,22 @@
my $i = 0;
#::logDebug($s->dump_coord(\@specs, 'BEFORE'));
- $s->{mv_coordinate} = ''
- unless $s->{mv_coordinate} and @specs == @{$s->{mv_search_field}};
+ if ( $s->{mv_force_coordinate} ) {
+ # If coordinated search is forced, ensure
+ # @specs == @{$s->{mv_search_field}}:
+ if ( $s->{mv_coordinate} ) {
+ my $last = $#{$s->{mv_search_field}};
+ my $i;
+ for ($i = @specs; $i <= $last; $i++) {
+ $specs[$i] = $specs[$#specs];
+ }
+ $#specs = $last;
+ }
+ }
+ else {
+ $s->{mv_coordinate} = ''
+ unless $s->{mv_coordinate} and @specs == @{$s->{mv_search_field}};
+ }
my $all_chars = $s->{mv_all_chars}[0];
2.35 interchange/lib/Vend/Scan.pm
rev 2.35, prev_rev 2.34
Index: Scan.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Scan.pm,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -r2.34 -r2.35
--- Scan.pm 9 Aug 2007 13:40:54 -0000 2.34
+++ Scan.pm 7 Jul 2008 18:15:07 -0000 2.35
@@ -1,6 +1,6 @@
# Vend::Scan - Prepare searches for Interchange
#
-# $Id: Scan.pm,v 2.34 2007-08-09 13:40:54 pajamian Exp $
+# $Id: Scan.pm,v 2.35 2008-07-07 18:15:07 docelic Exp $
#
# Copyright (C) 2002-2007 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -30,7 +30,7 @@
perform_search
);
-$VERSION = substr(q$Revision: 2.34 $, 10);
+$VERSION = substr(q$Revision: 2.35 $, 10);
use strict;
no warnings qw(uninitialized numeric);
@@ -59,6 +59,7 @@
mv_numeric
mv_column_op
mv_begin_string
+ mv_force_coordinate
mv_coordinate
mv_nextpage
mv_dict_end
@@ -136,6 +137,7 @@
dr mv_record_delim
em mv_exact_match
er mv_spelling_errors
+ fc mv_force_coordinate
ff mv_field_file
fi mv_search_file
ft mv_field_title
More information about the interchange-cvs
mailing list