1Xapian::Enquire(3)    User Contributed Perl Documentation   Xapian::Enquire(3)
2
3
4

NAME

6       Search::Xapian::Enquire - Make queries against a database
7

DESCRIPTION

9       This class provides an interface to the information retrieval system
10       for the purpose of searching.
11

METHODS

13       new
14       set_query
15           takes either a ready made Search::Xapian::Query or a scalar
16           containing a query, which in that case will be passed to
17           Search::Xapian::Query's constructor, together with any other passed
18           arguments.
19
20       set_query_object <query>
21       get_query
22       matches <start> <size> [<check_at_least>]
23           Takes the start element, and maximum number of elements (and
24           optionally the minimum number of matches to check), and returns an
25           array tied to Search::Xapian::MSet::Tied.
26
27       get_matching_terms_begin
28           Returns a Search::Xapian::TermIterator, pointing to the start of
29           the stream.
30
31       get_matching_terms_end
32           Returns a Search::Xapian::TermIterator, pointing to the end of the
33           stream.
34
35       set_collapse_key <collapse_key>
36       set_docid_order <order>
37           Set the direction in which documents are ordered by document id in
38           the returned MSet.
39
40           This order only has an effect on documents which would otherwise
41           have equal rank.  For a weighted probabilistic match with no sort
42           value, this means documents with equal weight.  For a boolean
43           match, with no sort value, this means all documents.  And if a sort
44           value is used, this means documents with equal sort value (and also
45           equal weight if ordering on relevance after the sort).
46
47           order can be ENQ_ASCENDING (the default, docids sort in ascending
48           order), ENQ_DESCENDING (docds sort in descending order), or
49           ENQ_DONT_CARE (docids sort in whatever order is most efficient for
50           the backend.)
51
52           Note: If you add documents in strict date order, then a boolean
53           search - i.e.
54           set_weighting_scheme(Search::Xapian::BoolWeight->new()) - with
55           set_docid_order(ENQ_DESCENDING) is a very efficient way to perform
56           "sort by date, newest first".
57
58       set_cutoff <percent_cutoff> [<weight_cutoff>]
59       set_sort_by_relevance
60           Set the sorting to be by relevance only.  This is the default.
61
62       set_sort_by_value <sort_key> [<ascending>]
63           Set the sorting to be by value only.
64
65           sort_key - value number to reorder on.  Sorting is with a string
66           compare.  If ascending is true (the default) higher is better; if
67           ascending is false, lower is better.
68
69           ascending - If true, document values which sort higher by string
70           compare are better.  If false, the sort order is reversed.
71           (default true)
72
73       set_sort_by_value_then_relevance <sort_key> [<ascending>]
74           Set the sorting to be by value, then by relevance for documents
75           with the same value.
76
77           sort_key - value number to reorder on.  Sorting is with a string
78           compare.  If ascending is true (the default) higher is better; if
79           ascending is false, lower is better.
80
81           ascending - If true, document values which sort higher by string
82           compare are better.  If false, the sort order is reversed.
83           (default true)
84
85       set_sort_by_relevance_then_value <sort_key> [<ascending>]
86           Set the sorting to be by relevance then value.
87
88           Note that with the default BM25 weighting scheme parameters, non-
89           identical documents will rarely have the same weight, so this
90           setting will give very similar results to set_sort_by_relevance().
91           It becomes more useful with particular BM25 parameter settings
92           (e.g. BM25Weight(1,0,1,0,0)) or custom weighting schemes.
93
94           sort_key - value number to reorder on.  Sorting is with a string
95           compare.  If ascending is true (the default) higher is better; if
96           ascending is false, lower is better.
97
98           ascending - If true, document values which sort higher by string
99           compare are better.  If false, the sort order is reversed.
100           (default true)
101
102       set_sort_by_key <sorter> [<ascending>]
103           Set the sorting to be by key only.
104
105           sorter - the functor to use to build the key.
106
107           ascending - If true, keys which sort higher by string compare are
108           better.  If false, the sort order is reversed.  (default true)
109
110       set_sort_by_key_then_relevance <sorter> [<ascending>]
111           Set the sorting to be by key, then by relevance for documents with
112           the same key.
113
114           sorter - the functor to use to build the key.
115
116           ascending - If true, keys which sort higher by string compare are
117           better.  If false, the sort order is reversed.  (default true)
118
119       set_sort_by_relevance_then_key <sorter> [<ascending>]
120           Set the sorting to be by relevance then key.
121
122           sorter - the functor to use to build the key.
123
124           ascending - If true, keys which sort higher by string compare are
125           better.  If false, the sort order is reversed.  (default true)
126
127       get_mset
128           Get match set.
129
130       get_eset <maxitems> <rset> [<decider>]
131           Get set of query expansion terms.
132
133       get_description
134           Return a description of this object.
135
136       add_matchspy <spy>
137           Add a matchspy.
138
139           This matchspy will be called with some of the documents which match
140           the query, during the match process.
141
142       clear_matchspies
143           Remove all the matchspies.
144

SEE ALSO

146       Search::Xapian::Query, Search::Xapian::Database,
147       Search::Xapian::MatchSpy
148
149
150
151perl v5.32.0                      2020-07-28                Xapian::Enquire(3)
Impressum