[Xapian-discuss] Summing collapsed values

Richard Boulton richard at lemurconsulting.com
Wed Mar 25 19:45:03 GMT 2009


On Wed, Mar 25, 2009 at 07:08:56PM +0000, Simon Roe wrote:
> On Wed, Mar 25, 2009 at 6:36 PM, Richard Boulton
> <richard at lemurconsulting.com> wrote:
> > And you want, for each of those documents to get the sum of the "amount"
> > for all the items which were collapsed?  ie, "15" for year=2000, "20" for
> > year=2001.
> 
> Another element I've just thought of:  I'd like to sort by the summed
> value too...
> 
> I guess that eliminates the double search option, would the matchspy
> option handle this?

No - you won't be able to sort by the summed value inside xapian; this kind
of thing isn't really how Xapian is designed to be used.  I wouldn't expect
this search to return very many results, though (it's limited by the number
of years in your database), so it seems like you might well be able to sort
the results outside xapian.

-- 
Richard



More information about the Xapian-discuss mailing list