C# 클래스 Lucene.Net.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 ({@link #matchesExtension(String, String) matchesExtension}), as well as generating file names from a segment name, generation and extension ( #fileNameFromGeneration(String, String, long) fileNameFromGeneration, #segmentFileName(String, String, String) segmentFileName).

NOTE: extensions used by codecs are not listed here. You must interact with the Codec directly. @lucene.internal

파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
CODEC_FILE_PATTERN System.Text.RegularExpressions.Regex
INDEX_EXTENSIONS string[]
SEGMENTS_GEN string

공개 메소드들

메소드 설명
FileNameFromGeneration ( string @base, string ext, long gen ) : string

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.

GetExtension ( string filename ) : string

Return the extension (anything after the first '.'), or null if there is no '.' in the file name.

MatchesExtension ( string filename, string ext ) : bool

Returns true if the given filename ends with the given extension. One should provide a pure extension, without '.'.

ParseSegmentName ( string filename ) : string

Parses the segment name out of the given file name.

SegmentFileName ( string segmentName, string segmentSuffix, string ext ) : 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 ext 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 filename ) : string

Removes the extension (anything after the first '.'), otherwise returns the original filename.

StripSegmentName ( string filename ) : string

Strips the segment name out of the given file name. If you used #segmentFileName or #fileNameFromGeneration to create your files, then this method simply removes whatever comes before the first '.', or the second '_' (excluding both).

비공개 메소드들

메소드 설명
IndexFileNames ( ) : System.Diagnostics

No instance

IndexOfSegmentName ( string filename ) : int

locates the boundary of the segment name, or -1

메소드 상세

FileNameFromGeneration() 공개 정적인 메소드

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.
public static FileNameFromGeneration ( string @base, string ext, long gen ) : string
@base string
ext string extension of the filename
gen long generation
리턴 string

GetExtension() 공개 정적인 메소드

Return the extension (anything after the first '.'), or null if there is no '.' in the file name.
public static GetExtension ( string filename ) : string
filename string
리턴 string

MatchesExtension() 공개 정적인 메소드

Returns true if the given filename ends with the given extension. One should provide a pure extension, without '.'.
public static MatchesExtension ( string filename, string ext ) : bool
filename string
ext string
리턴 bool

ParseSegmentName() 공개 정적인 메소드

Parses the segment name out of the given file name.
public static ParseSegmentName ( string filename ) : string
filename string
리턴 string

SegmentFileName() 공개 정적인 메소드

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 ext 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).

public static SegmentFileName ( string segmentName, string segmentSuffix, string ext ) : string
segmentName string
segmentSuffix string
ext string
리턴 string

StripExtension() 공개 정적인 메소드

Removes the extension (anything after the first '.'), otherwise returns the original filename.
public static StripExtension ( string filename ) : string
filename string
리턴 string

StripSegmentName() 공개 정적인 메소드

Strips the segment name out of the given file name. If you used #segmentFileName or #fileNameFromGeneration to create your files, then this method simply removes whatever comes before the first '.', or the second '_' (excluding both).
public static StripSegmentName ( string filename ) : string
filename string
리턴 string

프로퍼티 상세

CODEC_FILE_PATTERN 공개적으로 정적으로 프로퍼티

All files created by codecs much match this pattern (checked in SegmentInfo).
public static Regex,System.Text.RegularExpressions CODEC_FILE_PATTERN
리턴 System.Text.RegularExpressions.Regex

INDEX_EXTENSIONS 공개적으로 정적으로 프로퍼티

this array contains all filename extensions used by Lucene's index files, with one exception, namely the extension made up from .s + a number. Also note that Lucene's segments_N files do not have any filename extension.
public static string[] INDEX_EXTENSIONS
리턴 string[]

SEGMENTS_GEN 공개적으로 정적으로 프로퍼티

Name of the generation reference file name
public static string SEGMENTS_GEN
리턴 string