Lucy::Search::TermQuery - Query which matches individual terms.
my $term_query = Lucy::Search::TermQuery->new( field => 'content', term => 'foo', ); my $hits = $searcher->hits( query => $term_query );
TermQuery is a subclass of Query for matching individual terms in a specific field.
my $term_query = Lucy::Search::TermQuery->new( field => 'content', # required term => 'foo', # required );
Create a new TermQuery.
field - Field name.
term - Term text.
my $string = $term_query->get_field();
Accessor for object’s field member.
field
my $obj = $term_query->get_term();
Accessor for object’s term member.
term
my $compiler = $term_query->make_compiler( searcher => $searcher, # required boost => $boost, # required subordinate => $subordinate, # default: false );
Abstract factory method returning a Compiler derived from this Query.
searcher - A Searcher.
boost - A scoring multiplier.
subordinate - Indicates whether the Query is a subquery (as opposed to a top-level query). If false, the implementation must invoke normalize() on the newly minted Compiler object before returning it.
Lucy::Search::TermQuery isa Lucy::Search::Query isa Clownfish::Obj.
To install Lucy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lucy
CPAN shell
perl -MCPAN -e shell install Lucy
For more information on module installation, please visit the detailed CPAN module installation guide.