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.
  • Constructor Details

    • LuceneForwardIndex

      public LuceneForwardIndex​(java.lang.String indexFolder, org.ranksys.formats.parsing.Parser<C> uParser) throws java.io.IOException
      Constructor.
      Parameters:
      indexFolder - folder containing the index.
      uParser - user parser.
      Throws:
      java.io.IOException - if something fails while opening the index.
  • Method Details

    • getContentVector

      public FreqVector getContentVector​(int docID) throws java.io.IOException
      Description copied from interface: ForwardIndex
      Obtains a user vector.
      Specified by:
      getContentVector in interface ForwardIndex<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.IOException
      Description copied from interface: ForwardIndex
      Obtains the term frequency of a term in a user vector.
      Specified by:
      getTermFreq in interface ForwardIndex<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.