public final class IndexFileNames
extends java.lang.Object
matchesExtension
), as well as generating file names from a segment name,
generation and extension (
fileNameFromGeneration
,
segmentFileName
).Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
COMPOUND_EXTENSIONS
File extensions of old-style index files
|
static java.lang.String |
COMPOUND_FILE_EXTENSION
Extension of compound file
|
static java.lang.String |
COMPOUND_FILE_STORE_EXTENSION
Extension of compound file for doc store files
|
static java.lang.String |
DELETABLE
Name of the index deletable file (only used in
pre-lockless indices)
|
static java.lang.String |
DELETES_EXTENSION
Extension of deletes
|
static java.lang.String |
FIELD_INFOS_EXTENSION
Extension of field infos
|
static java.lang.String |
FIELDS_EXTENSION
Extension of stored fields file
|
static java.lang.String |
FIELDS_INDEX_EXTENSION
Extension of stored fields index file
|
static java.lang.String |
FREQ_EXTENSION
Extension of freq postings file
|
static java.lang.String |
GEN_EXTENSION
Extension of gen file
|
static java.lang.String[] |
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. |
static java.lang.String[] |
INDEX_EXTENSIONS_IN_COMPOUND_FILE
File extensions that are added to a compound file
(same as above, minus "del", "gen", "cfs").
|
static java.lang.String[] |
NON_STORE_INDEX_EXTENSIONS |
static java.lang.String |
NORMS_EXTENSION
Extension of norms file
|
static java.lang.String |
PLAIN_NORMS_EXTENSION
Extension of plain norms
|
static java.lang.String |
PROX_EXTENSION
Extension of prox postings file
|
static java.lang.String |
SEGMENTS
Name of the index segment file
|
static java.lang.String |
SEGMENTS_GEN
Name of the generation reference file name
|
static java.lang.String |
SEPARATE_NORMS_EXTENSION
Extension of separate norms
|
static java.lang.String[] |
STORE_INDEX_EXTENSIONS |
static java.lang.String |
TERMS_EXTENSION
Extension of terms file
|
static java.lang.String |
TERMS_INDEX_EXTENSION
Extension of terms index file
|
static java.lang.String[] |
VECTOR_EXTENSIONS
File extensions for term vector support
|
static java.lang.String |
VECTORS_DOCUMENTS_EXTENSION
Extension of vectors documents file
|
static java.lang.String |
VECTORS_FIELDS_EXTENSION
Extension of vectors fields file
|
static java.lang.String |
VECTORS_INDEX_EXTENSION
Extension of vectors index file
|
Constructor and Description |
---|
IndexFileNames() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
fileNameFromGeneration(java.lang.String base,
java.lang.String ext,
long gen)
Computes the full file name from base, extension and generation.
|
static boolean |
isDocStoreFile(java.lang.String fileName)
Returns true if the provided filename is one of the doc store files (ends
with an extension in
STORE_INDEX_EXTENSIONS ). |
static boolean |
isSeparateNormsFile(java.lang.String filename)
Returns true if the given filename ends with the separate norms file
pattern:
SEPARATE_NORMS_EXTENSION + "[0-9]+" . |
static boolean |
matchesExtension(java.lang.String filename,
java.lang.String ext)
Returns true if the given filename ends with the given extension.
|
static java.lang.String |
segmentFileName(java.lang.String segmentName,
java.lang.String ext)
Returns the file name that matches the given segment name and extension.
|
static java.lang.String |
stripSegmentName(java.lang.String filename)
Strips the segment file name out of the given one.
|
public static final java.lang.String SEGMENTS
public static final java.lang.String SEGMENTS_GEN
public static final java.lang.String DELETABLE
public static final java.lang.String NORMS_EXTENSION
public static final java.lang.String FREQ_EXTENSION
public static final java.lang.String PROX_EXTENSION
public static final java.lang.String TERMS_EXTENSION
public static final java.lang.String TERMS_INDEX_EXTENSION
public static final java.lang.String FIELDS_INDEX_EXTENSION
public static final java.lang.String FIELDS_EXTENSION
public static final java.lang.String VECTORS_FIELDS_EXTENSION
public static final java.lang.String VECTORS_DOCUMENTS_EXTENSION
public static final java.lang.String VECTORS_INDEX_EXTENSION
public static final java.lang.String COMPOUND_FILE_EXTENSION
public static final java.lang.String COMPOUND_FILE_STORE_EXTENSION
public static final java.lang.String DELETES_EXTENSION
public static final java.lang.String FIELD_INFOS_EXTENSION
public static final java.lang.String PLAIN_NORMS_EXTENSION
public static final java.lang.String SEPARATE_NORMS_EXTENSION
public static final java.lang.String GEN_EXTENSION
public static final java.lang.String[] INDEX_EXTENSIONS
.f
+ a number and
from .s
+ a number. Also note that
Lucene's segments_N
files do not have any
filename extension.public static final java.lang.String[] INDEX_EXTENSIONS_IN_COMPOUND_FILE
public static final java.lang.String[] STORE_INDEX_EXTENSIONS
public static final java.lang.String[] NON_STORE_INDEX_EXTENSIONS
public static final java.lang.String[] COMPOUND_EXTENSIONS
public static final java.lang.String[] VECTOR_EXTENSIONS
public static final java.lang.String fileNameFromGeneration(java.lang.String base, java.lang.String ext, long gen)
ext
is
not an empty string.base
- main part of the file nameext
- extension of the filenamegen
- generationpublic static final boolean isDocStoreFile(java.lang.String fileName)
STORE_INDEX_EXTENSIONS
).public static final java.lang.String segmentFileName(java.lang.String segmentName, java.lang.String ext)
ext
is not empty.public static final boolean matchesExtension(java.lang.String filename, java.lang.String ext)
public static final java.lang.String stripSegmentName(java.lang.String filename)
segmentFileName(java.lang.String, java.lang.String)
or fileNameFromGeneration(java.lang.String, java.lang.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.public static boolean isSeparateNormsFile(java.lang.String filename)
SEPARATE_NORMS_EXTENSION + "[0-9]+"
.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.