public class FSADocumentIndex extends FSArrayFile<DocumentIndexEntry> implements DocumentIndex
| Modifier and Type | Class and Description |
|---|---|
static class |
FSADocumentIndex.FSADocumentIndexIterator
Gets an iterator over the documents in this index
|
FSArrayFile.ArrayFileIterator<V extends org.apache.hadoop.io.Writable>, FSArrayFile.ArrayFileWriter| Modifier and Type | Field and Description |
|---|---|
protected int[] |
docLengths |
protected int |
lastDocid |
protected DocumentIndexEntry |
lastEntry |
protected static org.slf4j.Logger |
logger |
dataFile, dataFilename, entrySize, numberOfEntries, USUAL_EXTENSION, valueFactorymodCount| Modifier | Constructor and Description |
|---|---|
|
FSADocumentIndex(IndexOnDisk index,
String structureName)
Construct an instance of the class with
|
protected |
FSADocumentIndex(IndexOnDisk index,
String structureName,
boolean initialise) |
| Modifier and Type | Method and Description |
|---|---|
DocumentIndexEntry |
getDocumentEntry(int docid)
Get the document index entry based on its docid
|
int |
getDocumentLength(int docid)
Get the length of the document
|
int |
getNumberOfDocuments()
Get the number of documents
|
protected void |
initialise(IndexOnDisk index,
String structureName) |
close, get, iterator, size, writeFSArrayFileadd, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringprotected static final org.slf4j.Logger logger
protected int lastDocid
protected DocumentIndexEntry lastEntry
protected int[] docLengths
public FSADocumentIndex(IndexOnDisk index, String structureName) throws IOException
index - structureName - IOExceptionprotected FSADocumentIndex(IndexOnDisk index, String structureName, boolean initialise) throws IOException
IOExceptionprotected void initialise(IndexOnDisk index, String structureName) throws IOException
IOExceptionpublic final int getDocumentLength(int docid)
throws IOException
getDocumentLength in interface DocumentIndexIOExceptionpublic final DocumentIndexEntry getDocumentEntry(int docid) throws IOException
getDocumentEntry in interface DocumentIndexIOExceptionpublic int getNumberOfDocuments()
getNumberOfDocuments in interface DocumentIndexTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow