introducing new features :
authortipaul <tipaul>
Mon, 15 Mar 2004 15:03:35 +0000 (15:03 +0000)
committertipaul <tipaul>
Mon, 15 Mar 2004 15:03:35 +0000 (15:03 +0000)
* 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>)

search.marc/search.pl

index 558c33a..ec8390b 100755 (executable)
@@ -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",