[open-ils-commits] r19179 - branches/rel_1_6_1/Open-ILS/src/perlmods/OpenILS/Application/Search (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jan 13 22:02:21 EST 2011


Author: dbs
Date: 2011-01-13 22:02:19 -0500 (Thu, 13 Jan 2011)
New Revision: 19179

Modified:
   branches/rel_1_6_1/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
Log:
Enable truncation attribute in Z39.50 queries to be left out entirely

Per https://bugs.launchpad.net/evergreen/+bug/702695, some Z39.50
servers hate the truncation attribute (@attr 5=anything) and always
return 0 hits.

This gives you the ability to specify a negative value for the
truncation attribute and thereby prevent the truncation attribute
from being included in the Z39.50 query for a given server.


Modified: branches/rel_1_6_1/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
===================================================================
--- branches/rel_1_6_1/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm	2011-01-14 03:01:43 UTC (rev 19178)
+++ branches/rel_1_6_1/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm	2011-01-14 03:02:19 UTC (rev 19179)
@@ -447,7 +447,8 @@
 		next unless ( exists $services{$service}->{attrs}->{$_} );
 		$str .= '@attr 1=' . $services{$service}->{attrs}->{$_}->{code} . # add the use attribute
 			' @attr 4=' . $services{$service}->{attrs}->{$_}->{format}; # add the structure attribute
-		if (exists $services{$service}->{attrs}->{$_}->{truncation}){
+		if (exists $services{$service}->{attrs}->{$_}->{truncation}
+                &&  $services{$service}->{attrs}->{$_}->{truncation} >= 0) {
 			$str .= ' @attr 5=' . $services{$service}->{attrs}->{$_}->{truncation};
 		}
 		$str .= " \"" . $$hash{$_} . "\" "; # add the search term



More information about the open-ils-commits mailing list