Class LuceneForwardIndex<C>
java.lang.Object
es.uam.eps.ir.relison.content.index.AbstractIndex<C>
es.uam.eps.ir.relison.content.index.lucene.LuceneIndex<C>
es.uam.eps.ir.relison.content.index.lucene.LuceneForwardIndex<C>
- Type Parameters:
C- Type of the contents.
- All Implemented Interfaces:
DocumentMap<C>,ForwardIndex<C>,Index<C>
public class LuceneForwardIndex<C> extends LuceneIndex<C> implements ForwardIndex<C>
Lucene implementation of a forward index.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LuceneForwardIndex(java.lang.String indexFolder, org.ranksys.formats.parsing.Parser<C> uParser)Constructor. -
Method Summary
Modifier and Type Method Description FreqVectorgetContentVector(int docID)Obtains a user vector.longgetTermFreq(java.lang.String term, int docID)Obtains the term frequency of a term in a user vector.Methods inherited from class es.uam.eps.ir.relison.content.index.lucene.LuceneIndex
getAllTerms, getDocFreq, getPostings, getTotalFreq, numDocsMethods inherited from class es.uam.eps.ir.relison.content.index.AbstractIndex
getContent, getContentId, loadContentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.content.index.DocumentMap
getContent, getContentId, numDocsMethods inherited from interface es.uam.eps.ir.relison.content.index.Index
getAllTerms, getDocFreq, getPostings, getTotalFreq
-
Constructor Details
-
LuceneForwardIndex
public LuceneForwardIndex(java.lang.String indexFolder, org.ranksys.formats.parsing.Parser<C> uParser) throws java.io.IOExceptionConstructor.- Parameters:
indexFolder- folder containing the index.uParser- user parser.- Throws:
java.io.IOException- if something fails while opening the index.
-
-
Method Details
-
getContentVector
Description copied from interface:ForwardIndexObtains a user vector.- Specified by:
getContentVectorin interfaceForwardIndex<C>- Parameters:
docID- identifier of the content in the index.- Returns:
- a frequency vector for the corresponding content.
- Throws:
java.io.IOException- if something fails while reading the index.
-
getTermFreq
public long getTermFreq(java.lang.String term, int docID) throws java.io.IOExceptionDescription copied from interface:ForwardIndexObtains the term frequency of a term in a user vector.- Specified by:
getTermFreqin interfaceForwardIndex<C>- Parameters:
term- the term to look up.docID- the content identifier- Returns:
- the frequency of the term in the content vector
- Throws:
java.io.IOException- if something fails while reading the value.
-