perl - A CPAN module to parse google-style search query terms? -
i want turn query string of style:
my $query = q{recipe "with sauce" +eggs -pastrami};
into programmatic, sql::abstract query, used in dbix::class.
$where = { -and=>[ 'ingredients' =>[ { -like=>'%recipe%' }, { -like=>'%with sauce%' } ], 'ingredients' =>{ -like=>'%eggs%' }, -not => { 'ingredients => { -like => '%pastrami%' } } ]};
the above representation approximate. it's written ear, untested , no means syntactically nor conceptually correct.
what i'm looking prior art on subject, basic stuff. cpan module perhaps, or c library turned cpan module. there standard such thing?
the basic query parser in kinosearch (though default query boolean join parts or, can set and). have few ways approach stemming, token types, , wildcarding possible not built-in. has learning curve , docs bit thin highly recommend package. besides being done , terribly fast author extremely responsive feedback, questions, , bug reports.
Comments
Post a Comment