[Xapian-discuss] C++ PostingSource with Python bindings

Jason Tackaberry tack at urandom.ca
Sat Oct 13 01:10:41 BST 2012


On 12-10-08 01:11 AM, Olly Betts wrote:
> I'd try making the way you'd call this from Python:
>
>      q = xapian.Query(...)
>      mycustommodule.add_posting_source(q)
>
> And then in the C++ code, construct your new Query object and swap it
> with the old one:
>
>      Xapian::Query * q = (Xapian::Query*)(...);
>      Xapian::Query q_new(...);
>      std::swap(q_new, *q);

Thanks Olly.  This approach works great!



More information about the Xapian-discuss mailing list