fix total number of hits from Hyper Estraier
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Sat, 28 Jan 2006 19:49:03 +0000 (19:49 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Sat, 28 Jan 2006 19:49:03 +0000 (19:49 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@304 8392b6e1-25fa-0310-8288-cc32f8e212ea

lib/BackupPC/SearchLib.pm

index d8c0555..6bea327 100644 (file)
@@ -251,7 +251,7 @@ sub getHyperEstraier_url($) {
 
        return unless $use_hest;
 
-       use Search::Estraier;
+       use Search::Estraier 0.04;
        die "direct access to Hyper Estraier datatase is no longer supported. Please use estmaster\n"
                unless ($use_hest =~ m#^http://#);
 
@@ -300,8 +300,8 @@ sub getFilesHyperEstraier($) {
 
        $cond->add_attr("shareid NUMEQ $shareid") if ($shareid);
 
-#      $cond->set_max( $offset + $on_page );
-       $cond->set_options( SURE => 1 );
+       $cond->set_max( $offset + $on_page );
+       $cond->set_options( 'SURE' );
        $cond->set_order( getSort('search', 'est', $param->{'sort'} ) );
 
        # get the result of search
@@ -311,7 +311,7 @@ sub getFilesHyperEstraier($) {
        if ($hest_node_url) {
                $result = $db->search($cond, 0);
                if ($result) {
-                       $hits = $result->doc_num;
+                       $hits = $result->hits;
                } else {
                        $hits = 0;
                }
@@ -321,7 +321,7 @@ sub getFilesHyperEstraier($) {
 
        # for each document in result
        for my $i ($offset .. ($offset + $on_page - 1)) {
-               last if ($i >= $hits);
+               last if ($i >= $result->doc_num);
 
                my $doc;
                if ($hest_node_url) {