Document ids in Apache Lucy start at 1. Because 0 is never a valid doc id, we can use it as a sentinel value:
Code example for C is missing
The document ids used by Lucy are associated with a single index snapshot. The moment an index is updated, the mapping of document ids to documents is subject to change.
Since IndexReader objects represent a point-in-time view of an index, document ids are guaranteed to remain static for the life of the reader. However, because they are not permanent, Lucy document ids cannot be used as foreign keys to locate records in external data sources. If you truly need a primary key field, you must define it and populate it yourself.
Furthermore, the order of document ids does not tell you anything about the sequence in which documents were added to the index.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.