[Xapian-devel] Re: [Xapian-discuss] Searching subset of documents
Rusty Conover
rconover at infogears.com
Fri Jun 2 11:34:38 BST 2006
On Jun 2, 2006, at 3:15 AM, James Aylett wrote:
> On Fri, Jun 02, 2006 at 02:01:13AM +0100, Olly Betts wrote:
>
>> class MySQLFilter : public Xapian::ExternalPostingSource;
>>
>> Xapian::QueryParser qp;
>> // configure qp
>> Xapian::Query query = qp.parse_query(query_string);
>> Xapian::Query sql_filter(new MySQLFilter(/* some parameters */));
>
> Surely the type will be Xapian::ExternalPostingSource, not
> Xapian::Query?
>
>> query = Xapian::Query(OP_FILTER, query, sql_filter);
Olly and others,
Please disregard my previous email, after some hours of hacking I got
it all working, I think. Including a nice wrapper in perl with
Search::Xapian. I'll try and clean it up and send a diff later today
after I finish testing it for a while.
I did have to hack the Xapian::Query object to add a new OP type of
OP_EXTERNAL_POST_LIST, and store a reference to the implementation of
the ExternalPostingSource interface in the Internal class. Then some
changes in localmatch.cc, to have postlist_from_query just create a
new instance of ExternalSourcePostList with the reference to the
implementation provided to the Query constructor.
Thanks for all of your help,
Rusty
--
Rusty Conover
InfoGears Inc.
Web: http://www.infogears.com
More information about the Xapian-devel
mailing list