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 FreqVector
getContentVector(int docID)
Obtains a user vector.long
getTermFreq(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, numDocs
Methods inherited from class es.uam.eps.ir.relison.content.index.AbstractIndex
getContent, getContentId, loadContents
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface es.uam.eps.ir.relison.content.index.DocumentMap
getContent, getContentId, numDocs
Methods 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:ForwardIndex
Obtains a user vector.- Specified by:
getContentVector
in 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:ForwardIndex
Obtains the term frequency of a term in a user vector.- Specified by:
getTermFreq
in 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.
-