[Koha-cvs] CVS: koha/search.marc search.pl,1.12,1.13

Paul POULAIN tipaul at users.sourceforge.net
Mon Mar 15 16:03:38 CET 2004


Update of /cvsroot/koha/koha/search.marc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19786/search.marc

Modified Files:
	search.pl 
Log Message:
introducing new features :
* search on non marc fields : the marc field is found by a sub in Biblio.pm
* ordering a search

This commit shows the sql in log. Pls test it's correctly indexed (using : explain <sql_in_log>)


Index: search.pl
===================================================================
RCS file: /cvsroot/koha/koha/search.marc/search.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** search.pl	6 Mar 2004 20:26:13 -0000	1.12
--- search.pl	15 Mar 2004 15:03:35 -0000	1.13
***************
*** 109,112 ****
--- 109,113 ----
  	$resultsperpage= $query->param('resultsperpage');
  	$resultsperpage = 19 if(!defined $resultsperpage);
+ 	my $orderby = $query->param('orderby');
  
  	# builds tag and subfield arrays
***************
*** 114,123 ****
  
  	foreach my $marc (@marclist) {
! 		push @tags, $dbh->quote(substr($marc,0,4));
  	}
  	findseealso($dbh,\@tags);
  	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
  										\@excluding, \@operator, \@value,
! 										$startfrom*$resultsperpage, $resultsperpage);
  
  	($template, $loggedinuser, $cookie)
--- 115,129 ----
  
  	foreach my $marc (@marclist) {
! 		my ($tag,$subfield) = MARCfind_marc_from_kohafield($dbh,$marc);
! 		if ($tag) {
! 			push @tags,$dbh->quote("$tag$subfield");
! 		} else {
! 			push @tags, $dbh->quote(substr($marc,0,4));
! 		}
  	}
  	findseealso($dbh,\@tags);
  	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
  										\@excluding, \@operator, \@value,
! 										$startfrom*$resultsperpage, $resultsperpage,$orderby);
  
  	($template, $loggedinuser, $cookie)





More information about the Koha-cvs mailing list