[Xapian-discuss] Random ordering from Python

amix amix at amix.dk
Wed Jan 21 22:34:54 GMT 2009


I have tried different full text search engines (Lucene, Sphinx) and I
must say that Xapian is my favorite (full unicode support + live index
updates are really nice features).

I have run into a problem thought and it's sorting a result set randomly.

I have tried to implement my own random weight, but that did not work
out. I would also like this random sorting to perform good and work on
big result sets.

Is this possible (I would really like to see some example code if it's
possible :-)). I am using Xapian from Python (which probably makes
things harder).

I am using this random ordering to suggest a person some other
interesting people (for example, some users from Denmark that are
between 20 and 30 years old).

I could do random selects easily if counts were exact counts and not
estimates - so returning exact counts would also solve my problem. I
need performance thought, so setting check_at_least to 1 million is
not a solution (unless it performs really good).

Kind Regards,
Amir Salihefendic ( http://amix.dk/ )



More information about the Xapian-discuss mailing list