-
-
27 Feb 2018 08:40:23 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues
- Testers (1248 / 3 / 7)
- Kwalitee
Bus factor: 1- License: apache_2_0
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (1.12MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- The Apache Lucy Project <dev at lucy dot apache dot org>
- Dependencies
- Clownfish
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Lucy::Search::LeafQuery - Leaf node in a tree created by QueryParser.
SYNOPSIS
package MyQueryParser; use base qw( Lucy::Search::QueryParser ); sub expand_leaf { my ( $self, $leaf_query ) = @_; if ( $leaf_query->get_text =~ /.\*\s*$/ ) { return PrefixQuery->new( query_string => $leaf_query->get_text, field => $leaf_query->get_field, ); } else { return $self->SUPER::expand_leaf($leaf_query); } }
DESCRIPTION
LeafQuery objects serve as leaf nodes in the tree structure generated by QueryParser’s tree() method. Ultimately, they must be transformed, typically into either TermQuery or PhraseQuery objects, as attempting to search a LeafQuery causes an error.
CONSTRUCTORS
new
my $leaf_query = Lucy::Search::LeafQuery->new( text => '"three blind mice"', # required field => 'content', # default: undef );
Create a new LeafQuery.
field - Optional field name.
text - Raw query text.
METHODS
get_field
my $string = $leaf_query->get_field();
Accessor for object’s
field
attribute.get_text
my $string = $leaf_query->get_text();
Accessor for object’s
text
attribute.make_compiler
my $compiler = $leaf_query->make_compiler( searcher => $searcher, # required boost => $boost, # required subordinate => $subordinate, # default: false );
Throws an error.
INHERITANCE
Lucy::Search::LeafQuery isa Lucy::Search::Query isa Clownfish::Obj.
Module Install Instructions
To install Lucy, copy and paste the appropriate command in to your terminal.
cpanm Lucy
perl -MCPAN -e shell install Lucy
For more information on module installation, please visit the detailed CPAN module installation guide.