Development

Changeset 25622

You must first sign up to be able to contribute.

Changeset 25622

Show
Ignore:
Timestamp:
12/19/09 10:42:24 (3 years ago)
Author:
rande
Message:

[sfLucenePlugin] [solr] fix the page number

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfLucenePlugin/branches/1.2-Solr/lib/results/sfLucenePager.class.php

    r25443 r25622  
    4444    $this->results = $lucene_results->toArray(); 
    4545    $this->search_parameters = $lucene_results->getRawResult()->sf_lucene_search; 
     46 
     47    // compute the page number from the results 
     48    $limit = $lucene_results->getRawResult()->sf_lucene_search['limit']; 
     49     
     50    $start = $this->getResults()->getRawResult()->response->start; 
     51 
     52    $this->setPage((int)($start  / $limit) + 1); 
     53    $this->must_reload = false; 
     54 
    4655     
    4756    $this->search = $search === null ? $lucene_results->getSearch() : $search; 
     
    156165  public function getPage() 
    157166  { 
     167 
    158168    return $this->page; 
    159169  } 
     
    174184  public function getFirstPage() 
    175185  { 
     186     
    176187    return 1; 
    177188  }