public class LimIndexReader
extends IndexReader
| Modifier and Type | Field and Description |
|---|---|
private int |
workCount |
private int |
workLimit |
private IndexReader |
wrapped |
| Constructor and Description |
|---|
LimIndexReader(IndexReader toWrap,
int workLimit)
Wrap an index reader and enforce the specified limit.
|
| Modifier and Type | Method and Description |
|---|---|
Directory |
directory() |
int |
docFreq(Term t) |
protected void |
doClose() |
protected void |
doCommit() |
Document |
document(int n) |
Document |
document(int n,
FieldSelector fieldSelector) |
protected void |
doDelete(int docNum) |
protected void |
doSetNorm(int doc,
String field,
byte value) |
protected void |
doUndeleteAll() |
boolean |
equals(Object obj) |
static long |
getCurrentVersion(Directory directory) |
static long |
getCurrentVersion(File directory) |
static long |
getCurrentVersion(String directory) |
Collection |
getFieldNames(IndexReader.FieldOption opt) |
TermFreqVector |
getTermFreqVector(int docNumber,
String field) |
TermFreqVector[] |
getTermFreqVectors(int docNumber) |
long |
getVersion() |
boolean |
hasDeletions() |
int |
hashCode() |
boolean |
hasNorms(String field) |
static boolean |
indexExists(Directory directory) |
static boolean |
indexExists(File directory) |
static boolean |
indexExists(String directory) |
boolean |
isCurrent() |
boolean |
isDeleted(int n) |
static boolean |
isLocked(Directory directory) |
static boolean |
isLocked(String directory) |
boolean |
isOptimized() |
int |
maxDoc() |
byte[] |
norms(String field) |
void |
norms(String field,
byte[] bytes,
int offset) |
int |
numDocs() |
static IndexReader |
open(Directory directory) |
static IndexReader |
open(File path) |
static IndexReader |
open(String path) |
void |
setNorm(int doc,
String field,
float value) |
TermDocs |
termDocs() |
TermDocs |
termDocs(Term term) |
TermPositions |
termPositions() |
TermPositions |
termPositions(Term term) |
TermEnum |
terms() |
TermEnum |
terms(Term t) |
String |
toString() |
static void |
unlock(Directory directory) |
protected void |
work(int amount)
Called by LimTermDocs and LimTermPositions to notify us that a certain
amount of work has been done.
|
private IndexReader wrapped
private int workLimit
private int workCount
public LimIndexReader(IndexReader toWrap,
int workLimit)
toWrap - The reader to wrapworkLimit - Limit on the amount of wokrprotected void work(int amount)
throws IOException
amount - How much work has been done. The unit is typically one
term or term-position.IOExceptionpublic Document document(int n,
FieldSelector fieldSelector)
throws IOException
document in class IndexReaderIOExceptionpublic static long getCurrentVersion(File directory)
throws IOException
IOExceptionpublic static long getCurrentVersion(String directory)
throws IOException
IOExceptionpublic static long getCurrentVersion(Directory directory)
throws IOException
IOExceptionpublic static boolean indexExists(File directory)
public static boolean indexExists(String directory)
public static boolean indexExists(Directory directory)
throws IOException
IOExceptionpublic static boolean isLocked(String directory)
throws IOException
IOExceptionpublic static boolean isLocked(Directory directory)
throws IOException
IOExceptionpublic static IndexReader open(File path)
throws IOException
IOExceptionpublic static IndexReader open(String path)
throws IOException
IOExceptionpublic static IndexReader open(Directory directory)
throws IOException
IOExceptionpublic static void unlock(Directory directory)
throws IOException
IOExceptionpublic Directory directory()
directory in class IndexReaderpublic int docFreq(Term t)
throws IOException
docFreq in class IndexReaderIOExceptionpublic Document document(int n)
throws IOException
document in class IndexReaderIOExceptionpublic boolean equals(Object obj)
equals in class Objectpublic TermFreqVector getTermFreqVector(int docNumber,
String field)
throws IOException
getTermFreqVector in class IndexReaderIOExceptionpublic TermFreqVector[] getTermFreqVectors(int docNumber)
throws IOException
getTermFreqVectors in class IndexReaderIOExceptionpublic boolean hasDeletions()
hasDeletions in class IndexReaderpublic int hashCode()
hashCode in class Objectpublic boolean isDeleted(int n)
isDeleted in class IndexReaderpublic int maxDoc()
maxDoc in class IndexReaderpublic byte[] norms(String field)
throws IOException
norms in class IndexReaderIOExceptionpublic void norms(String field,
byte[] bytes,
int offset)
throws IOException
norms in class IndexReaderIOExceptionpublic int numDocs()
numDocs in class IndexReaderpublic void setNorm(int doc,
String field,
float value)
throws IOException
setNorm in class IndexReaderIOExceptionpublic TermDocs termDocs()
throws IOException
termDocs in class IndexReaderIOExceptionpublic TermDocs termDocs(Term term)
throws IOException
termDocs in class IndexReaderIOExceptionpublic TermPositions termPositions()
throws IOException
termPositions in class IndexReaderIOExceptionpublic TermPositions termPositions(Term term)
throws IOException
termPositions in class IndexReaderIOExceptionpublic TermEnum terms()
throws IOException
terms in class IndexReaderIOExceptionpublic TermEnum terms(Term t)
throws IOException
terms in class IndexReaderIOExceptionpublic String toString()
toString in class Objectprotected void doClose()
throws IOException
doClose in class IndexReaderIOExceptionprotected void doCommit()
throws IOException
doCommit in class IndexReaderIOExceptionprotected void doDelete(int docNum)
throws IOException
doDelete in class IndexReaderIOExceptionprotected void doSetNorm(int doc,
String field,
byte value)
throws IOException
doSetNorm in class IndexReaderIOExceptionprotected void doUndeleteAll()
throws IOException
doUndeleteAll in class IndexReaderIOExceptionpublic Collection getFieldNames(IndexReader.FieldOption opt)
getFieldNames in class IndexReaderpublic long getVersion()
getVersion in class IndexReaderpublic boolean hasNorms(String field)
throws IOException
hasNorms in class IndexReaderIOExceptionpublic boolean isCurrent()
throws IOException
isCurrent in class IndexReaderIOExceptionpublic boolean isOptimized()
isOptimized in class IndexReader