[Xapian-discuss] timing behaviour for creating large queries
Bill Crawford
bill.crawford at wcn.co.uk
Wed Feb 7 17:36:35 GMT 2007
On Wednesday 07 February 2007 17:27, Richard Boulton wrote:
> The C++ interface supports a constructor which takes a sequence of terms
> to build an OR query out of - this should get around the quadratic
> complexity you're seeing (though I haven't tested to check). I'm not
> belive that construction method is available from Perl, having taken a
> quick peek at the XS code.
It does indeed, at least in the version I'm using:
if (scalar @filterTerms) {
my $filter = Search::Xapian::Query->new (OP_AND, @filterTerms);
$query = Search::Xapian::Query->new (OP_FILTER, $suppliedQuery, $filter);
} else {
$query = $suppliedQuery;
}
Basically if you pass in more than one argument, they all have to be EITHER
search terms OR already constructed (sub)query objects.
--
http://www.lost.eu/175db
More information about the Xapian-discuss
mailing list