[Xapian-devel] Bindings and overloading

Alex Bowley alex-xapian at hyperspeed.org
Thu Jun 3 15:50:23 BST 2004


On Thu, Jun 03, 2004 at 03:25PM, James Aylett wrote:
> q = xapian.Query(xapian.Query.OP_PHRASE, ['bodega', 'sell', 'fish'])
> 
> but it doesn't work because (I think) we're either not instantiating
> the right template, or possibly because we're missing a typemap. I'm
> looking at this at the moment, but I don't know how much time I can
> devote to it.

How did one construct >2 element phrases in Xapian before the existence
of the variable-term constructor?
I've tried creating one via a binary tree-like approach, but this throws
exceptions (whatever the language).

For example, in perl:

alex at ixion:~$ perl -M'Search::Xapian qw(:all)' -l
my $query1 = Search::Xapian::Query->new(OP_PHRASE, q[foo], q[bar]);
print $query1;
my $query2 = Search::Xapian::Query->new(OP_PHRASE, q[baz], q[quux]);
print $query2;
my $query3 = Search::Xapian::Query->new(OP_PHRASE, $query1, $query2);
print $query3;
Xapian::Query((foo PHRASE 2 bar))
Xapian::Query((baz PHRASE 2 quux))
Exception: Can't use NEAR/PHRASE with a subexpression containing NEAR or
PHRASE at /s1/alex/local/lib/perl/5.6.1/Search/Xapian/Query.pm line 58.


-- 
Alex Bowley                                           http://hyperspeed.org/
"An expert is someone who knows some of the worst mistakes that can be made
 in his subject and who manages to avoid them."          - Werner Heisenberg




More information about the Xapian-devel mailing list