Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lucene::queryparser(3pm) [debian man page]

QueryParser(3pm)					User Contributed Perl Documentation					  QueryParser(3pm)

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. The other function, "deparse_query" turns such a data structure back into a Lucene query string. This is useful if you've just been mucking about with the data. PLUCENE Note for people using Plucene: the big arrayref and the hashes in the output of "parse_query" are actually objects. They're not "Plucene::Query" objects, because then everyone who wanted to do search queries would have to pull in Plucene, which is a bit unfair. How- ever, they can be turned into "Plucene::Query"s by calling "to_plucene" on them. The argument to "to_plucene" should be the default field to search if none is supplied. EXPORT Exports the "parse_query" and "deparse_query" functions. 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. perl v5.8.8 2008-04-19 QueryParser(3pm)

Check Out this Related Man Page

Plucene::Search::Query(3pm)				User Contributed Perl Documentation			       Plucene::Search::Query(3pm)

NAME
Plucene::Search::Query - base class for queries SYNOPSIS
my $s_query = Plucene::Search::Query::Subclass->new({ boost => $boost_factor}); my $scorer = $s_query->scorer($query, $searcher, $reader); DESCRIPTION
This is an abstract base class for queries. A query is a specification of the content an properties of the desired documents. Every search is done by matching a query against the document index and locating the ones that match the query. The simplest query specifies a single term (or word) that is to be matched against a single field (e.g. 'author') of each of the documents in the index. This kind of query matches any document that contains the term in the specified field. A more complex queries may contain nested queries with 'and', 'or', 'not' or 'phrase' relations. Queries may also contains specification of which document fields to match against the various parts of the query (.e.g. 'authors' and 'title') and hints that may effects the ranking of the matched documents ('boost' factor). METHODS
new my $s_query = Plucene::Search::Query::Subclass->new({ boost => $boost_factor}); boost Get / set this attribute scorer my $scorer = $s_query->scorer (Plucene::Search::Query $query, $searcher, $reader); prepare Does nothing sum_squared_weights / normalize / _scorer These must be defined in a subclass perl v5.12.4 2011-08-14 Plucene::Search::Query(3pm)
Man Page