[Xapian-devel] Re: [Xapian-discuss] Searching subset of documents

Rusty Conover rconover at infogears.com
Fri Jun 2 01:11:04 BST 2006


On Jun 1, 2006, at 12:45 PM, Olly Betts wrote:


> 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.

Hi Olly & the rest of xapian-devel,

Thanks for your help so far.  I'm a stuck on the problem of how to  
properly expose this new class, called ExternalSourcePostList to  
public users of the Xapian API.   I've created matcher/ 
externalsourcepostlist.cc and matcher/externalsourcepostlist.h.

It seems the header "postlist.h" isn't installed when Xapian is  
installed, so there needs to be some housekeeping allow this class to  
be used but not show its internal bits.  This I'd like a little help  
with.

I've attached my source files for the new class to this email.  I've  
kept it really simple, just expecting an array of Xapian::docids to  
be passed to the constructor, where they are copied and sorted, and  
the rest of the iterator functions are implemented correctly as far  
as I can tell.

Thanks again,

Rusty
--
Rusty Conover
InfoGears Inc.
Web: http://www.infogears.com




-------------- next part --------------
Skipped content of type multipart/mixed


More information about the Xapian-devel mailing list