[Xapian-discuss] searching and sorting by date

James Aylett james-xapian at tartarus.org
Wed Mar 22 11:49:40 GMT 2006


On Tue, Mar 21, 2006 at 10:56:32PM -0800, Michel Pelletier wrote:

> We have a use case where we must return the first 50 most recent 
> documents that match our query.  We don't want the first 50 matches to 
> the query that are then sorted by date.  I hope the distinction is clear 
> enough.  What we are unsure of from reading the documents is if setting 
> a sort value on our query (enq.set_sort_by_value()) will return the 
> first 50 documents that match the query, or the first 50 matches, then 
> sorted by that value.

Hi, Michel. Olly is away right now; others may be able to back me up
here, but my understanding is that set_sort_by_value() will give you
the first N (documents that match the query sorted by the value). This
is slower than not sorting for precisely this reason.

Does that answer your question? It's pretty easy to distinguish
between the two - you only need about three documents in a db, and to
request an mset of size 1.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list