1Lucy::Search::PhraseQueUrsye(r3)Contributed Perl DocumenLtuactyi:o:nSearch::PhraseQuery(3)
2
3
4
6 Lucy::Search::PhraseQuery - Query matching an ordered list of terms.
7
9 my $phrase_query = Lucy::Search::PhraseQuery->new(
10 field => 'content',
11 terms => [qw( the who )],
12 );
13 my $hits = $searcher->hits( query => $phrase_query );
14
16 PhraseQuery is a subclass of Query for matching against an ordered
17 sequence of terms.
18
20 new
21 my $phrase_query = Lucy::Search::PhraseQuery->new(
22 field => $field, # required
23 terms => $terms, # required
24 );
25
26 Create a new PhraseQuery.
27
28 • field - The field that the phrase must occur in.
29
30 • terms - The ordered array of terms that must match.
31
33 get_field
34 my $string = $phrase_query->get_field();
35
36 Accessor for objectXs field attribute.
37
38 get_terms
39 my $arrayref = $phrase_query->get_terms();
40
41 Accessor for objectXs array of terms.
42
43 make_compiler
44 my $compiler = $phrase_query->make_compiler(
45 searcher => $searcher, # required
46 boost => $boost, # required
47 subordinate => $subordinate, # default: false
48 );
49
50 Abstract factory method returning a Compiler derived from this Query.
51
52 • searcher - A Searcher.
53
54 • boost - A scoring multiplier.
55
56 • subordinate - Indicates whether the Query is a subquery (as opposed
57 to a top-level query). If false, the implementation must invoke
58 normalize() on the newly minted Compiler object before returning
59 it.
60
62 Lucy::Search::PhraseQuery isa Lucy::Search::Query isa Clownfish::Obj.
63
64
65
66perl v5.36.0 2022-07-22 Lucy::Search::PhraseQuery(3)