[Xapian-discuss] Searching subset of documents

Olly Betts olly at survex.com
Thu Jun 1 19:45:23 BST 2006


On Thu, Jun 01, 2006 at 12:23:25PM -0600, Rusty Conover wrote:
> On Jun 1, 2006, at 9:19 AM, Olly Betts wrote:
> >It'd be handy to have something like this available, and it's not too
> >hard to implement.  I'm not likely to have time to look at it for a
> >while, but I can point you in the right direction if you want to look.
> 
> I'd be happy to spend some time on this, if you have any hints about  
> where to start they would be most appreciated.

The place to start is common/postlist.h - this is the base class which
you need to derive from.  Some methods have defaults in that header,
others aren't really relevant for a postlist always used for filtering
- all the weight methods can just give a weight of zero.  If there's
no way to more usefully implement skip_to(), just use a while loop to
call next() if we aren't already at the required position.

Then you "just" need to get this postlist created in the right place
inside Enquire and hooked into the query tree!

For this to worth adding the release tree, I think it would need to be
wrapped in an API akin to that of MatchDecider - an API class which can
be used to implement the customisation you want by subclassing.  But you
don't need that to prove the idea works - you can just jury rig it
inside Enquire.

Feel free to ask questions, though if it's going to get involved,
xapian-devel is probably more appropriate than this list.

Cheers,
    Olly



More information about the Xapian-discuss mailing list