Sphinx search displays correct results but I'm running into a problem with pagination. If my search returns 3 records, it would say "Page 1 of 1, showing 15 records out of 15 total, starting on record 1, ending on 15". Say my keyword is "How", app/views/posts/index.ctp
shows 3 records with the word "How" but my pagination shows "showing 15 records out of 15 total" instead of "showing 3 records out of 3 total."
I have these lines in my code:
$sphinx = array('matchMode' => SPH_MATCH_ALL, 'sortMode' => array(SPH_SORT_EXTENDED => '@relevance DESC'));
$results = $this->Post->find('all', array('search' => $this->data['Post']['query'], 'sphinx' => $sphinx));
$this->set('posts', $results, $this->paginate());
How should I go about fixing the pagination so it will show the correct number of items found?