Package org.terrier.realtime.multi
Class MultiDoc
- java.lang.Object
-
- org.terrier.realtime.multi.MultiDoc
-
- All Implemented Interfaces:
DocumentIndex
public class MultiDoc extends java.lang.Object implements DocumentIndex
A Document index class that represents multiple document indices from different shards. It is used within MultiIndex.- Since:
- 4.0
- Author:
- Richard McCreadie, Stuart Mackie
-
-
Constructor Summary
Constructors Constructor Description MultiDoc(DocumentIndex[] docs, int[] offsets)constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentIndexEntrygetDocumentEntry(int docid)Return the document index entry based on its docid.intgetDocumentLength(int docid)Return the length of the document.intgetNumberOfDocuments()Return the number of documents.
-
-
-
Constructor Detail
-
MultiDoc
public MultiDoc(DocumentIndex[] docs, int[] offsets)
constructor.
-
-
Method Detail
-
getDocumentEntry
public DocumentIndexEntry getDocumentEntry(int docid) throws java.io.IOException
Return the document index entry based on its docid.- Specified by:
getDocumentEntryin interfaceDocumentIndex- Returns:
- the document index entry based on its docid.
- Throws:
java.io.IOException
-
getDocumentLength
public int getDocumentLength(int docid) throws java.io.IOExceptionReturn the length of the document.- Specified by:
getDocumentLengthin interfaceDocumentIndex- Returns:
- the length of the document.
- Throws:
java.io.IOException
-
getNumberOfDocuments
public int getNumberOfDocuments()
Return the number of documents.- Specified by:
getNumberOfDocumentsin interfaceDocumentIndex- Returns:
- the number of documents.
-
-