Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7931143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:38:11+00:00 2026-06-03T20:38:11+00:00

Sphinx search displays correct results but I’m running into a problem with pagination. If

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:38:12+00:00Added an answer on June 3, 2026 at 8:38 pm

    Firstly you’re not providing enough information for the community to understand where the problem resides…

    I could suggest you try AJAX based pagination (link1 , link2) and include the output of that in your sphinx output, but I do not know if you’re experiencing problems connected (only) to Shpinx or Cake, or both?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Sphinx to search MySQL. One of the results Sphinx returns for a
I am using Sphinx Search . It's working fine for me except one problem:
How to search @ | & ( ) in sphinx. I want the results
I'm thinking about using Sphinx as a search engine for my site. But since
Im beginning to learn sphinx search php api after running this query <?php include('sphinxapi.php');
I asked before for a simple solution to my problem (using sphinx search service)
I have Sphinx Search running on a Linux server with 38GB of RAM. The
Have my sphinx search going like so: $result = $cl->query($_REQUEST['term'], 'myindex'); But I'd like
We have a database that we would like to index with Sphinx search engine.
I would like to search text for words prefiexed by $. Sample records (table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.