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 6825759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:04:11+00:00 2026-05-26T22:04:11+00:00

Has anyone ever gotten the Sphinx ranking options to work? I’ve read the manual

  • 0

Has anyone ever gotten the Sphinx ranking options to work? I’ve read the manual and the book but cannot get ranking working at all. From what I understand, ranking simply computes the weights in a different manner, doesn’t do any type of sorting. I have my results sorted by @weight (internal sphinx field) and using sort mode extended, which you need for this, yet cannot see any difference between different ranking modes. My config is something like this:

$cl->SetMatchMode( SPH_MATCH_EXTENDED2 );  
$cl->SetSortMode ( SPH_SORT_EXTENDED, "mylang DESC, @weight DESC, @id"); 

Neither of these makes any difference:

$cl->setRankingMode(SPH_RANK_SPH04);
$cl->setRankingMode(SPH_RANK_PROXIMITY_BM25);

And the weights are the same in either mode.

Ultimately, what I’m trying to achieve is to have terms that match exactly be sorted towards the top. So for example, if searching for “Harry Potter” the results should be as follows:

Harry Potter
Harry Potter and the potters
Harry Potter and the Prisoner of Azkaban
Harry Potter and the Deathly Hallows: Part 1

This is just an example, but the first result should be the one that contains the exact search term, then the others would follow. This is not happening. Anyone have any experience with this?

  • 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-05-26T22:04:11+00:00Added an answer on May 26, 2026 at 10:04 pm

    Turns out that SPH_RANK_SPH04 is not included in the sphinxapi.php file in version 0.9.9!!! So even though you’re calling it it’s not taken into account and furthermore does not produce an error.

    This is terrible because it makes it very hard to troubleshoot.

    I’ve posted this as the answer in the hopes that it helps someone else. We lost almost 2 days going crazy over this until we figured it out.

    Furthermore, there is a bug in 2.0.1 which doesn’t really bring some exact matches to the front, for that you need 2.0.2 (which you need to get from SVN) or above, but I’d be very weary of using experimental versions in production.

    Hopefully the Sphinx developers will take care of this soon.

    PS
    Looking back at the developer diaries, it does say:

    “As of 1.10-beta, Sphinx has 8 different rankers”

    We upgraded from 0.9.9 to 2.0.1 and must have left the api file behind, and in desperation I never even checked this. It would still be nice for Sphinx to throw an error if the ranking mode doesn’t exist (as it does for other modes such as matching), and the 2.0.1 bug is still there as far as we can tell in our tests.

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

Sidebar

Related Questions

Has anyone ever done work to get Ruby to do continuations (like Seaside on
has anyone ever read/skimmed through this book? it is valuable/very helpful to people such
Has anyone ever gotten this error or know what it relates to? I got
Has anyone ever been able to get a FacesMessage to appear when one is
Has anyone ever gotten a response from Facebook after you've applied for the "publish_stream"
has anyone ever tried to get the list of all the movieclips (even the
Has anyone ever encountered a situation where this code doesn't work: $('#whatever').css({ left:'+=7px' });
More a theoretical question. We compress/minify css & js, but has anyone ever thought
Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project?
Has anyone ever heard of a UNIX shell written in a reasonable language, like

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.