java.lang.Object | |
↳ | org.apache.lucene.index.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
), as well as generating file names from a segment name,
generation and extension (
fileNameFromGeneration
,
segmentFileName
).
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | COMPOUND_FILE_EXTENSION | Extension of compound file | |||||||||
String | COMPOUND_FILE_STORE_EXTENSION | Extension of compound file for doc store files | |||||||||
String | DELETABLE | Name of the index deletable file (only used in pre-lockless indices) | |||||||||
String | DELETES_EXTENSION | Extension of deletes | |||||||||
String | FIELDS_EXTENSION | Extension of stored fields file | |||||||||
String | FIELDS_INDEX_EXTENSION | Extension of stored fields index file | |||||||||
String | FIELD_INFOS_EXTENSION | Extension of field infos | |||||||||
String | FREQ_EXTENSION | Extension of freq postings file | |||||||||
String | GEN_EXTENSION | Extension of gen file | |||||||||
String | NORMS_EXTENSION | Extension of norms file | |||||||||
String | PLAIN_NORMS_EXTENSION | Extension of plain norms | |||||||||
String | PROX_EXTENSION | Extension of prox postings file | |||||||||
String | SEGMENTS | Name of the index segment file | |||||||||
String | SEGMENTS_GEN | Name of the generation reference file name | |||||||||
String | SEPARATE_NORMS_EXTENSION | Extension of separate norms | |||||||||
String | TERMS_EXTENSION | Extension of terms file | |||||||||
String | TERMS_INDEX_EXTENSION | Extension of terms index file | |||||||||
String | VECTORS_DOCUMENTS_EXTENSION | Extension of vectors documents file | |||||||||
String | VECTORS_FIELDS_EXTENSION | Extension of vectors fields file | |||||||||
String | VECTORS_INDEX_EXTENSION | Extension of vectors index file |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
COMPOUND_EXTENSIONS | File extensions of old-style index files | ||||||||||
INDEX_EXTENSIONS | This array contains all filename extensions used by
Lucene's index files, with two exceptions, namely the
extension made up from .f + a number and
from .s + a number. |
||||||||||
INDEX_EXTENSIONS_IN_COMPOUND_FILE | File extensions that are added to a compound file (same as above, minus "del", "gen", "cfs"). | ||||||||||
NON_STORE_INDEX_EXTENSIONS | |||||||||||
STORE_INDEX_EXTENSIONS | |||||||||||
VECTOR_EXTENSIONS | File extensions for term vector support |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Computes the full file name from base, extension and generation.
| |||||||||||
Returns true if the provided filename is one of the doc store files (ends
with an extension in
STORE_INDEX_EXTENSIONS ). | |||||||||||
Returns true if the given filename ends with the separate norms file
pattern:
SEPARATE_NORMS_EXTENSION + "[0-9]+" . | |||||||||||
Returns true if the given filename ends with the given extension.
| |||||||||||
Returns the file name that matches the given segment name and extension.
| |||||||||||
Strips the segment file name out of the given one.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Extension of compound file for doc store files
Name of the index deletable file (only used in pre-lockless indices)
Extension of stored fields index file
Name of the generation reference file name
Extension of terms index file
Extension of vectors documents file
Extension of vectors fields file
Extension of vectors index file
This array contains all filename extensions used by
Lucene's index files, with two exceptions, namely the
extension made up from .f
+ a number and
from .s
+ a number. Also note that
Lucene's segments_N
files do not have any
filename extension.
File extensions that are added to a compound file (same as above, minus "del", "gen", "cfs").
Computes the full file name from base, extension and generation. If the
generation is -1, the file name is null. If it's 0, the file name is
<base>.<ext>. If it's > 0, the file name is
<base>_<gen>.<ext>.
NOTE: .<ext> is added to the name only if ext
is
not an empty string.
base | main part of the file name |
---|---|
ext | extension of the filename |
gen | generation |
Returns true if the provided filename is one of the doc store files (ends
with an extension in STORE_INDEX_EXTENSIONS
).
Returns true if the given filename ends with the separate norms file
pattern: SEPARATE_NORMS_EXTENSION + "[0-9]+"
.
Returns true if the given filename ends with the given extension. One should provide a pure extension, without '.'.
Returns the file name that matches the given segment name and extension.
This method takes care to return the full file name in the form
<segmentName>.<ext>, therefore you don't need to prefix the
extension with a '.'.
NOTE: .<ext> is added to the result file name only if
ext
is not empty.
Strips the segment file name out of the given one. If you used
segmentFileName(String, String)
or fileNameFromGeneration(String, String, long)
to create your
files, then this method simply removes whatever comes before the first '.',
or the second '_' (excluding both), in case of deleted docs.