.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "QueryParser 3pm" .TH QueryParser 3pm "2016-04-23" "perl v5.22.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Lucene::QueryParser \- Turn a Lucene query into a Perl data structure .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Lucene::QueryParser; \& my $structure = parse_query("red and yellow and \-(coat:pink and green)"); .Ve .PP \&\f(CW$structure\fR will be: .PP .Vb 8 \& [ { query => \*(AqTERM\*(Aq, type => \*(AqNORMAL\*(Aq, term => \*(Aqred\*(Aq }, \& { query => \*(AqTERM\*(Aq, type => \*(AqNORMAL\*(Aq, term => \*(Aqyellow\*(Aq }, \& { subquery => [ \& { query => \*(AqTERM\*(Aq, type => \*(AqNORMAL\*(Aq, term => \*(Aqpink\*(Aq, field => \*(Aqcoat\*(Aq }, \& { query => \*(AqTERM\*(Aq, type => \*(AqNORMAL\*(Aq, term => \*(Aqgreen\*(Aq } \& ], query => \*(AqSUBQUERY\*(Aq, type => \*(AqPROHIBITED\*(Aq \& } \& ] .Ve .SH "DESCRIPTION" .IX Header "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 .PP It deals with fields, types, phrases, subqueries, and so on; everything handled by the \f(CW\*(C`SimpleQuery\*(C'\fR class in Lucene. The data structure is similar to the one given above, and is pretty self-explanatory. .PP The other function, \f(CW\*(C`deparse_query\*(C'\fR turns such a data structure back into a Lucene query string. This is useful if you've just been mucking about with the data. .SS "\s-1PLUCENE\s0" .IX Subsection "PLUCENE" Note for people using Plucene: the big arrayref and the hashes in the output of \f(CW\*(C`parse_query\*(C'\fR are actually objects. They're not \&\f(CW\*(C`Plucene::Query\*(C'\fR objects, because then everyone who wanted to do search queries would have to pull in Plucene, which is a bit unfair. However, they can be turned into \f(CW\*(C`Plucene::Query\*(C'\fRs by calling \f(CW\*(C`to_plucene\*(C'\fR on them. The argument to \f(CW\*(C`to_plucene\*(C'\fR should be the default field to search if none is supplied. .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" Exports the \f(CW\*(C`parse_query\*(C'\fR and \f(CW\*(C`deparse_query\*(C'\fR functions. .SH "AUTHOR" .IX Header "AUTHOR" Simon Cozens, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2003 by Kasei .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.