1Xapian::TermGenerator(3U)ser Contributed Perl DocumentatiXoanpian::TermGenerator(3)
2
3
4
6 Search::Xapian::TermGenerator - Parses a piece of text and generates
7 terms.
8
10 This module takes a piece of text and parses it to produce words which
11 are then used to generate suitable terms for indexing. The terms
12 generated are suitable for use with Search::Xapian::Query objects
13 produced by the Search::Xapian::QueryParser class.
14
16 use Search::Xapian;
17
18 my $doc = new Search::Xapian::Document();
19 my $tg = new Search::Xapian::TermGenerator();
20 $tg->set_stemmer(new Search::Xapian::Stem("english"));
21 $tg->set_document($doc);
22 $tg->index_text("The cat sat on the mat");
23
25 new TermGenerator constructor.
26
27 set_stemmer <stemmer>
28 Set the Search::Xapian::Stem object to be used for generating
29 stemmed terms.
30
31 set_stopper <stopper>
32 Set the Search::Xapian::Stopper object to be used for identifying
33 stopwords.
34
35 set_document <document>
36 Set the Search::Xapian::Document object to index terms into.
37
38 get_document <document>
39 Get the currently set Search::Xapian::Document object.
40
41 index_text <text> [<wdf_inc> [<prefix>]]
42 Indexes the text in string <text>. The optional parameter
43 <wdf_inc> sets the wdf increment (default 1). The optional
44 parameter <prefix> sets the term prefix to use (default is no
45 prefix).
46
47 index_text_without_positions <text> [<wdf_inc> [<prefix>]]
48 Just like index_text, but no positional information is generated.
49 This means that the database will be significantly smaller, but
50 that phrase searching and NEAR won't be supported.
51
52 increase_termpos [<delta>]
53 Increase the termpos used by index_text by <delta> (default 100).
54
55 This can be used to prevent phrase searches from spanning two
56 unconnected blocks of text (e.g. the title and body text).
57
58 get_termpos
59 Get the current term position.
60
61 set_termpos <termpos>
62 Set the current term position.
63
64 get_description
65 Return a description of this object.
66
68 https://xapian.org/docs/sourcedoc/html/classXapian_1_1TermGenerator.html
69
70
71
72perl v5.36.0 2022-07-22 Xapian::TermGenerator(3)