Package org.apache.lucene.index
Class SegmentInfo
- java.lang.Object
-
- org.apache.lucene.index.SegmentInfo
-
-
Constructor Summary
Constructors Constructor Description SegmentInfo(String name, int docCount, Directory dir, boolean isCompoundFile, boolean hasSingleNormFile, boolean hasProx, boolean hasVectors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
boolean
equals(Object obj)
We consider another SegmentInfo instance equal if it has the same dir and same name.List<String>
files()
int
getDelCount()
String
getDelFileName()
Map<String,String>
getDiagnostics()
boolean
getDocStoreIsCompoundFile()
int
getDocStoreOffset()
String
getDocStoreSegment()
boolean
getHasProx()
boolean
getHasVectors()
String
getNormFileName(int number)
Get the file name for the norms file for this field.boolean
getUseCompoundFile()
Returns true if this segment is stored as a compound file; else, false.String
getVersion()
Returns the version of the code which wrote the segment.boolean
hasDeletions()
int
hashCode()
boolean
hasSeparateNorms()
Returns true if any fields in this segment have separate norms.boolean
hasSeparateNorms(int fieldNumber)
Returns true if this field for this segment has saved a separate norms file (__N.sX). void
setDocStoreSegment(String segment)
void
setHasVectors(boolean v)
long
sizeInBytes(boolean includeDocStores)
Returns total size in bytes of all of files used by this segment (ifincludeDocStores
is true), or the size of all files except the store files otherwise.String
toString()
String
toString(Directory dir, int pendingDelCount)
Used for debugging.
-
-
-
Method Detail
-
sizeInBytes
public long sizeInBytes(boolean includeDocStores) throws IOException
Returns total size in bytes of all of files used by this segment (ifincludeDocStores
is true), or the size of all files except the store files otherwise.- Throws:
IOException
-
getHasVectors
public boolean getHasVectors() throws IOException
- Throws:
IOException
-
setHasVectors
public void setHasVectors(boolean v)
-
hasDeletions
public boolean hasDeletions() throws IOException
- Throws:
IOException
-
getDelFileName
public String getDelFileName()
-
hasSeparateNorms
public boolean hasSeparateNorms(int fieldNumber) throws IOException
Returns true if this field for this segment has saved a separate norms file (__N.sX). - Parameters:
fieldNumber
- the field index to check- Throws:
IOException
-
hasSeparateNorms
public boolean hasSeparateNorms() throws IOException
Returns true if any fields in this segment have separate norms.- Throws:
IOException
-
getNormFileName
public String getNormFileName(int number) throws IOException
Get the file name for the norms file for this field.- Parameters:
number
- field index- Throws:
IOException
-
getUseCompoundFile
public boolean getUseCompoundFile() throws IOException
Returns true if this segment is stored as a compound file; else, false.- Throws:
IOException
-
getDelCount
public int getDelCount() throws IOException
- Throws:
IOException
-
getDocStoreOffset
public int getDocStoreOffset()
-
getDocStoreIsCompoundFile
public boolean getDocStoreIsCompoundFile()
-
getDocStoreSegment
public String getDocStoreSegment()
-
setDocStoreSegment
public void setDocStoreSegment(String segment)
-
getHasProx
public boolean getHasProx()
-
files
public List<String> files() throws IOException
- Throws:
IOException
-
toString
public String toString(Directory dir, int pendingDelCount)
Used for debugging. Format may suddenly change.Current format looks like
_a(3.1):c45/4->_1
, which means the segment's name is_a
; it was created with Lucene 3.1 (or '?' if it's unkown); it's using compound file format (would beC
if not compound); it has 45 documents; it has 4 deletions (this part is left off when there are no deletions); it's using the shared doc stores named_1
(this part is left off if doc stores are private).
-
equals
public boolean equals(Object obj)
We consider another SegmentInfo instance equal if it has the same dir and same name.
-
getVersion
public String getVersion()
Returns the version of the code which wrote the segment.
-
-