From 98dbf5769f743859da862b28734f8c0145eb5285 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 15 Mar 2004 15:03:35 +0000 Subject: [PATCH] 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 ) --- search.marc/search.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/search.marc/search.pl b/search.marc/search.pl index 558c33a1ac..ec8390b713 100755 --- a/search.marc/search.pl +++ b/search.marc/search.pl @@ -108,17 +108,23 @@ if ($op eq "do_search") { $resultsperpage= $query->param('resultsperpage'); $resultsperpage = 19 if(!defined $resultsperpage); + my $orderby = $query->param('orderby'); # builds tag and subfield arrays my @tags; foreach my $marc (@marclist) { - push @tags, $dbh->quote(substr($marc,0,4)); + 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); + $startfrom*$resultsperpage, $resultsperpage,$orderby); ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "search.marc/result.tmpl", -- 2.39.5