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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:54:55+00:00 2026-06-02T13:54:55+00:00

Hi im using sphinx 201 beta (r2792) i have rt index with rt_attr_uint =

  • 0

Hi im using sphinx 201 beta (r2792)

i have rt index with rt_attr_uint = rake my goal is to sort results by this attribute
whitch work as expected using

$this->sphinx->SetSortMode(SPH_SORT_EXTENDED, 'rake DESC')

but i want to also randomize this result … lets say i have this data

(id,  title,  rake)
  1, 'test',  3
  2, 'test2', 3
  3, 'ásdf',  1
  4, 'rreer', 0

so after i append random

$this->sphinx->SetSortMode(SPH_SORT_EXTENDED, 'rake DESC, @random')

i would expect randomize result sorted by attribute rake descending
but im getting error:

sort-by attribute '@random' not found

whitch i dont understand because this random attribute is internal attribute
am i doing something wrong? where could be a problem? thanks

  • 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-02T13:55:00+00:00Added an answer on June 2, 2026 at 1:55 pm

    What I did is create the random number on the SQL query

    SELECT ...  RAND() as random_sort, ...
    

    Added it as an attribute

    sql_attr_float = random_sort
    

    And then use it in the extended sort query

    $this->sphinx->SetSortMode(SPH_SORT_EXTENDED, 'rake DESC, random_sort DESC');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Thinking Sphinx for full-text search, following this video . I'd like to
im using Sphinx and i have configured my gammar model path which is build\class\FYP
Doing a search using django-sphinx gives me results._sphinx that says there were 68 results,
How can I get all the records from the index using Sphinx? Just like
I have a website that is using Sphinx search server to search through a
So, when using Sphinx searches are limited to 1000 results. But, if there are
I'm using Sphinx to search MySQL. One of the results Sphinx returns for a
I'm using Hudson to generate the documentation for a Python project using Sphinx. This
We have a database that we would like to index with Sphinx search engine.
I am using Sphinx quite often. There is one index that calls a stored

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.