1LucyX::Search::ProximitUysQeurerCyo(n3t)ributed Perl DocLuumceynXt:a:tSieoanrch::ProximityQuery(3)
2
3
4
6 LucyX::Search::ProximityQuery - Query matching an ordered list of
7 terms.
8
10 my $proximity_query = LucyX::Search::ProximityQuery->new(
11 field => 'content',
12 terms => [qw( the who )],
13 within => 10, # match within 10 positions
14 );
15 my $hits = $searcher->hits( query => $proximity_query );
16
18 ProximityQuery is a subclass of Query for matching against an ordered
19 sequence of terms.
20
22 new
23 my $proximity_query = LucyX::Search::ProximityQuery->new(
24 field => $field, # required
25 terms => $terms, # required
26 within => $within, # required
27 );
28
29 Create a new ProximityQuery.
30
31 • field - The field that the phrase must occur in.
32
33 • terms - The ordered array of terms that must match.
34
36 get_field
37 my $string = $proximity_query->get_field();
38
39 Accessor for objectXs field attribute.
40
41 get_terms
42 my $arrayref = $proximity_query->get_terms();
43
44 Accessor for objectXs array of terms.
45
46 get_within
47 my $int = $proximity_query->get_within();
48
49 Accessor for objectXs within attribute.
50
51 make_compiler
52 my $compiler = $proximity_query->make_compiler(
53 searcher => $searcher, # required
54 boost => $boost, # required
55 subordinate => $subordinate, # default: false
56 );
57
58 Abstract factory method returning a Compiler derived from this Query.
59
60 • searcher - A Searcher.
61
62 • boost - A scoring multiplier.
63
64 • subordinate - Indicates whether the Query is a subquery (as opposed
65 to a top-level query). If false, the implementation must invoke
66 normalize() on the newly minted Compiler object before returning
67 it.
68
70 LucyX::Search::ProximityQuery isa Lucy::Search::Query isa
71 Clownfish::Obj.
72
73
74
75perl v5.34.0 2021-07-22 LucyX::Search::ProximityQuery(3)