This module contains base classes/interfaces for “codec” objects.
Do not instantiate this object directly. It is used by the Index object to hold information about a segment. A list of objects of this class are pickled as part of the TOC file.
The TOC file stores a minimal amount of information – mostly a list of Segment objects. Segments are the real reverse indexes. Having multiple segments allows quick incremental indexing: just create a new segment for the new documents, and have the index overlay the new segment over previous ones for purposes of reading/search. “Optimizing” the index combines the contents of existing segments into one (removing any deleted documents along the way).
Convenience method to create a new file in the given storage named with this segment’s ID and the given extension. Any keyword arguments are passed to the storage’s create_file method.
Deletes the given document number. The document is not actually removed from the index until it is optimized.
Parameters: |
|
---|
Returns: | the total number of deleted documents in this segment. |
---|
Returns: | the number of (undeleted) documents in this segment. |
---|
Returns the total number of documents, DELETED OR UNDELETED, in this segment.
Returns: | True if any documents in this segment are deleted. |
---|
Returns: | True if the given document number is deleted. |
---|
Convenience method to open a file in the given storage named with this segment’s ID and the given extension. Any keyword arguments are passed to the storage’s open_file method.