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.IOException
public Document document(int n, FieldSelector fieldSelector) throws IOException
document
in class IndexReader
IOException
public static long getCurrentVersion(File directory) throws IOException
IOException
public static long getCurrentVersion(String directory) throws IOException
IOException
public static long getCurrentVersion(Directory directory) throws IOException
IOException
public static boolean indexExists(File directory)
public static boolean indexExists(String directory)
public static boolean indexExists(Directory directory) throws IOException
IOException
public static boolean isLocked(String directory) throws IOException
IOException
public static boolean isLocked(Directory directory) throws IOException
IOException
public static IndexReader open(File path) throws IOException
IOException
public static IndexReader open(String path) throws IOException
IOException
public static IndexReader open(Directory directory) throws IOException
IOException
public static void unlock(Directory directory) throws IOException
IOException
public Directory directory()
directory
in class IndexReader
public int docFreq(Term t) throws IOException
docFreq
in class IndexReader
IOException
public Document document(int n) throws IOException
document
in class IndexReader
IOException
public boolean equals(Object obj)
equals
in class Object
public TermFreqVector getTermFreqVector(int docNumber, String field) throws IOException
getTermFreqVector
in class IndexReader
IOException
public TermFreqVector[] getTermFreqVectors(int docNumber) throws IOException
getTermFreqVectors
in class IndexReader
IOException
public boolean hasDeletions()
hasDeletions
in class IndexReader
public int hashCode()
hashCode
in class Object
public boolean isDeleted(int n)
isDeleted
in class IndexReader
public int maxDoc()
maxDoc
in class IndexReader
public byte[] norms(String field) throws IOException
norms
in class IndexReader
IOException
public void norms(String field, byte[] bytes, int offset) throws IOException
norms
in class IndexReader
IOException
public int numDocs()
numDocs
in class IndexReader
public void setNorm(int doc, String field, float value) throws IOException
setNorm
in class IndexReader
IOException
public TermDocs termDocs() throws IOException
termDocs
in class IndexReader
IOException
public TermDocs termDocs(Term term) throws IOException
termDocs
in class IndexReader
IOException
public TermPositions termPositions() throws IOException
termPositions
in class IndexReader
IOException
public TermPositions termPositions(Term term) throws IOException
termPositions
in class IndexReader
IOException
public TermEnum terms() throws IOException
terms
in class IndexReader
IOException
public TermEnum terms(Term t) throws IOException
terms
in class IndexReader
IOException
public String toString()
toString
in class Object
protected void doClose() throws IOException
doClose
in class IndexReader
IOException
protected void doCommit() throws IOException
doCommit
in class IndexReader
IOException
protected void doDelete(int docNum) throws IOException
doDelete
in class IndexReader
IOException
protected void doSetNorm(int doc, String field, byte value) throws IOException
doSetNorm
in class IndexReader
IOException
protected void doUndeleteAll() throws IOException
doUndeleteAll
in class IndexReader
IOException
public Collection getFieldNames(IndexReader.FieldOption opt)
getFieldNames
in class IndexReader
public long getVersion()
getVersion
in class IndexReader
public boolean hasNorms(String field) throws IOException
hasNorms
in class IndexReader
IOException
public boolean isCurrent() throws IOException
isCurrent
in class IndexReader
IOException
public boolean isOptimized()
isOptimized
in class IndexReader