[sup-talk] Sorting

Carl Worth cworth at cworth.org
Mon Dec 14 18:12:41 EST 2009


On Mon, 14 Dec 2009 11:01:39 -0600, Michael McDermott <mcdermott.michaelj at gmail.com> wrote:
> After running a search in Sup, is there any way to sort the result set? Or,
> perhaps, specify the ordering in the query? (ala SQL)

The Xapian database (which Sup uses optionally now and perhaps
exclusively in the future) allows results to be sorted by anything
stored in a "value" field of the documents.

If I recall correctly, Sup is currently storing three things in "value"
fields:

	1. Message ID

        2. Thread ID (which is Message ID of a representative message)

	3. Date

So it's quite easy to have Xapian return things based on an ordering of
any one of those values (in either direction). And this does not require
fetching all documents.

Sorting on anything else would require either fetching all documents,
(and doing the sort in the user-interface), or else storing an
additional value for each document in the database.

What is it that you actually want to sort on?

-carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20091214/b4017175/attachment-0001.bin>


More information about the sup-talk mailing list