1Lucy::Docs::DocIDs(3) User Contributed Perl DocumentationLucy::Docs::DocIDs(3)
2
3
4
6 Lucy::Docs::DocIDs - Characteristics of Apache Lucy document ids.
7
9 Document ids are signed 32-bit integers
10 Document ids in Apache Lucy start at 1. Because 0 is never a valid doc
11 id, we can use it as a sentinel value:
12
13 while ( my $doc_id = $posting_list->next ) {
14 ...
15 }
16
17 Document ids are ephemeral
18 The document ids used by Lucy are associated with a single index
19 snapshot. The moment an index is updated, the mapping of document ids
20 to documents is subject to change.
21
22 Since IndexReader objects represent a point-in-time view of an index,
23 document ids are guaranteed to remain static for the life of the
24 reader. However, because they are not permanent, Lucy document ids
25 cannot be used as foreign keys to locate records in external data
26 sources. If you truly need a primary key field, you must define it and
27 populate it yourself.
28
29 Furthermore, the order of document ids does not tell you anything about
30 the sequence in which documents were added to the index.
31
32
33
34perl v5.28.0 2018-07-14 Lucy::Docs::DocIDs(3)