Matthew Somerville
2008-Feb-14 19:35 UTC
[Xapian-discuss] allterms_begin(prefix) on a WritableDatabase
Is there any reason that, in the Perl bindings, the allterms_begin/end in Search::Xapian::WritableDatabase do not allow a prefix, while those in Search::Xapian::Database do? (I want to fetch all the Q prefixed terms from Xapian and compare them against our database to see if any Xapian entries can be removed as they're no longer present in the database.) I'm happy to supply a patch if that's helpful, although it wouldn't be any more than copying the relevant prefix bits from the Search::Xapian::Database section as I'm no XS expert :-) ATB, Matthew
Olly Betts
2008-Feb-15 11:35 UTC
[Xapian-discuss] allterms_begin(prefix) on a WritableDatabase
On Thu, Feb 14, 2008 at 07:35:24PM +0000, Matthew Somerville wrote:> Is there any reason that, in the Perl bindings, the allterms_begin/end in > Search::Xapian::WritableDatabase do not allow a prefix, while those in > Search::Xapian::Database do?Not a good reason. I just only updated one version of the wrapper. Ideally, the Search::Xapian::Database methods would be automatically inherited by Search::Xapian::WritableDatabase, but that doesn't seem to happen. I don't know if this is just how XS works, or if we're doing something wrong. I'm hoping we can move Search::Xapian to use SWIG at some point, but that needs SWIG to support "directors" for Perl, which is doesn't yet. There is a somewhat dated patch though.> I'm happy to supply a patch if that's helpfulYes, that would be handy. A small regression test would be useful too (assuming there's one for Database, just repeating that for WritableDatabase would be fine.> although it wouldn't be any more than > copying the relevant prefix bits from the Search::Xapian::Database section > as I'm no XS expert :-)That's the way to do it, unless we can persuade it to inherit. Cheers, Olly