[Xapian-discuss] Perl bindings: QueryParser::OP_AND

Olly Betts olly at survex.com
Fri Jul 14 21:08:55 BST 2006


On Fri, Jul 14, 2006 at 12:32:15PM -0700, John Wang wrote:
> Thanks. That did it. I wasn't importing anything. Maybe it's not possible
> with OP_* but I can use the following (without quotes) fine without
> importing :db :
> 
> Search::Xapian::DB_CREATE_OR_OPEN

Right, I thought that was the correct syntax.

I'm not sure why it's different for OP_.  The only difference in
handling the two cases I can see in the bindings is in Xapian.pm:

    our @OP_NAMES;
    foreach (@{ $EXPORT_TAGS{'ops'} }) {
      $OP_NAMES[eval $_] = $_;
    }
    
    our @DB_NAMES;
    foreach (@{ $EXPORT_TAGS{'dbs'} }) {
      $DB_NAMES[eval $_] = $_;
    }

The latter case should be 'db' not 'dbs' so it currently doesn't do
anything since $EXPORT_TAGS{'dbs'} will be empty.  I'm not quite
sure what this code is for anyway.

> Perhaps that's not intentional and not recommended? I've moved to importing
> :db and using DB_CREATE_OR_OPEN unqualified for that.

I believe it is meant to work, though Alex is really the authority on this.
It's used in the test cases at least...

I don't have time to look into this further currently, and there is at least
an easy workaround, but I'll try to work out what's going on later.

Cheers,
    Olly



More information about the Xapian-discuss mailing list