[Catalyst] Re: Catalyst::Model::Xapian usage
Adam Jacob
adam at stalecoffee.org
Tue Jan 23 18:43:53 GMT 2007
On Jan 23, 2007, at 5:41 AM, Adam Sj=F8gren wrote:
> On Sun, 14 Jan 2007 19:01:00 -0800, Adam wrote:
>
>> Personally, I wrote my own model to Xapian. I also wound up re- =
>> writing
>> the query parser, because I needed things like range searching and
> ^^.. ..^^
> Sounds interesting! Do you care to share your code, or briefly explain
> what is needed to do range searching?
I would be happy to share the code, although it's not really CPAN- =
ready quite yet. The short version is that implementing things like =
Range searching and Regular Expressions requires manually walking =
through the term list, and adding all the terms that match to the query.
It's basically the same way that Xapian's default query parser =
handles right side wildcarding. You jump to the point in the =
termlist to begin, and go until you get past the second condition.
Just for kicks, I've attached the basic class here. It's taken from =
part of a larger project, and it definitely has some bugs. If you =
decide to improve it, I would love patches.
Thanks!
Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: XapianParser.pm
Type: text/x-perl-script
Size: 12352 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070123/56c7=
97f9/XapianParser.bin
More information about the Catalyst
mailing list