Search code examples
searchrandomsphinxrandom-seed

Adding a seed to random sphinx search


I am attempting to return a random series of results for a Sphinx search, but add a seed to @random so that results are maintained over a paginated set of results.

Currently, we are retrieving a random set of results using the following code:

SetSortMode(SPH_SORT_EXTENDED, "@random ASC");

Is it possible to add a seed to this random sorting mode?


Solution

  • As far as I'm aware Sphinx added rand_seed option just a while ago that may serve your purpose.

    http://sphinxsearch.com/docs/current/sphinxql-select.html

    Mind you, it'll be only in the one of the newer builds of Sphinx.