Class IndexFileNames
This class contains useful constants representing filenames and extensions used by lucene, as well as convenience methods for querying whether a file name matches an extension (MatchesExtension(String, String)), as well as generating file names from a segment name, generation and extension (FileNameFromGeneration(String, String, Int64), SegmentFileName(String, String, String)).
NOTE: extensions used by codecs are not listed here. You must interact with the Codec directly.
@lucene.internal
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public sealed class IndexFileNames : object
Fields
Name | Description |
---|---|
CODEC_FILE_PATTERN | All files created by codecs much match this pattern (checked in SegmentInfo). |
COMPOUND_FILE_ENTRIES_EXTENSION | Extension of compound file entries |
COMPOUND_FILE_EXTENSION | Extension of compound file |
GEN_EXTENSION | Extension of gen file |
INDEX_EXTENSIONS | This array contains all filename extensions used by
Lucene's index files, with one exception, namely the
extension made up from |
SEGMENTS | Name of the index segment file |
SEGMENTS_GEN | Name of the generation reference file name |
Methods
Name | Description |
---|---|
FileNameFromGeneration(String, String, Int64) | Computes the full file name from base, extension and generation. If the
generation is -1, the file name is
NOTE: .<ext> is added to the name only if |
GetExtension(String) | Return the extension (anything after the first '.'), or null if there is no '.' in the file name. |
MatchesExtension(String, String) | Returns |
ParseSegmentName(String) | Parses the segment name out of the given file name. |
SegmentFileName(String, String, String) | Returns a file name that includes the given segment name, your own custom name and extension. The format of the filename is: <segmentName>(_<name>)(.<ext>). NOTE: .<ext> is added to the result file name only if is not empty.
NOTE: _<segmentSuffix> is added to the result file name only if it's not the empty string NOTE: all custom files should be named using this method, or otherwise some structures may fail to handle them properly (such as if they are added to compound files). |
StripExtension(String) | Removes the extension (anything after the first '.'), otherwise returns the original filename. |
StripSegmentName(String) | Strips the segment name out of the given file name. If you used SegmentFileName(String, String, String) or FileNameFromGeneration(String, String, Int64) to create your files, then this method simply removes whatever comes before the first '.', or the second '_' (excluding both). |