1Lucy::Index::DeletionsWUrsietrerC(o3n)tributed Perl DocuLmuecnyt:a:tIinodnex::DeletionsWriter(3)
2
3
4
6 Lucy::Index::DeletionsWriter - Abstract base class for marking
7 documents as deleted.
8
10 my $polyreader = $del_writer->get_polyreader;
11 my $seg_readers = $polyreader->seg_readers;
12 for my $seg_reader (@$seg_readers) {
13 my $count = $del_writer->seg_del_count( $seg_reader->get_seg_name );
14 ...
15 }
16
18 Subclasses of DeletionsWriter provide a low-level mechanism for
19 declaring a document deleted from an index.
20
21 Because files in an index are never modified, and because it is not
22 practical to delete entire segments, a DeletionsWriter does not
23 actually remove documents from the index. Instead, it communicates to
24 a search-time companion DeletionsReader which documents are deleted in
25 such a way that it can create a Matcher iterator.
26
27 Documents are truly deleted only when the segments which contain them
28 are merged into new ones.
29
31 delete_by_term
32 $deletions_writer->delete_by_term(
33 field => $field, # required
34 term => $term, # required
35 );
36
37 Delete all documents in the index that index the supplied term.
38
39 · field - The name of an indexed field. (If it is not specXd as
40 "indexed", an error will occur.)
41
42 · term - The term which identifies docs to be marked as deleted. If
43 "field" is associated with an Analyzer, "term" will be processed
44 automatically (so donXt pre-process it yourself).
45
46 delete_by_query
47 $deletions_writer->delete_by_query($query);
48
49 Delete all documents in the index that match "query".
50
51 · query - A Query.
52
53 updated
54 my $bool = $deletions_writer->updated();
55
56 Returns true if there are updates that need to be written.
57
58 seg_del_count
59 my $int = $deletions_writer->seg_del_count($seg_name);
60
61 Return the number of deletions for a given segment.
62
63 · seg_name - The name of the segment.
64
66 Lucy::Index::DeletionsWriter isa Lucy::Index::DataWriter isa
67 Clownfish::Obj.
68
69
70
71perl v5.28.0 2018-07-14 Lucy::Index::DeletionsWriter(3)