NAME
Lucene::QueryParser - Turn a Lucene query into a Perl data structure
SYNOPSIS
use Lucene::QueryParser;
my $structure = parse_query("red and yellow and -(coat:pink and green)");
$structure
will be:
[ { query => 'TERM', type => 'NORMAL', term => 'red' },
{ query => 'TERM', type => 'NORMAL', term => 'yellow' },
{ subquery => [
{ query => 'TERM', type => 'NORMAL', term => 'pink', field => 'coat' },
{ query => 'TERM', type => 'NORMAL', term => 'green' }
], query => 'SUBQUERY', type => 'PROHIBITED'
}
]
DESCRIPTION
This module parses a Lucene query, as defined by http://lucene.sourceforge.net/cgi-bin/faq/faqmanager.cgi?file=chapter.search&toc=faq#q5
It deals with fields, types, phrases, subqueries, and so on; everything handled by the SimpleQuery
class in Lucene. The data structure is similar to the one given above, and is pretty self-explanatory.
EXPORT
Exports the parse_query
function.
AUTHOR
Simon Cozens, <simon@kasei.com>
COPYRIGHT AND LICENSE
Copyright 2003 by Kasei
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.