org.terrier.structures
Class BlockInvertedIndex

java.lang.Object
  extended by org.terrier.structures.BitPostingIndex
      extended by org.terrier.structures.InvertedIndex
          extended by org.terrier.structures.BlockInvertedIndex
All Implemented Interfaces:
java.io.Closeable, IndexConfigurable, PostingIndex<BitIndexPointer>

public class BlockInvertedIndex
extends InvertedIndex
implements IndexConfigurable

This class implements the block field inverted index for performing retrieval.

Author:
Douglas Johnson, Craig Macdonald et al.

Field Summary
protected  int DocumentBlockCountDelta
           
 
Fields inherited from class org.terrier.structures.InvertedIndex
doi, FIELD_LOAD_FACTOR, logger, NORMAL_LOAD_FACTOR
 
Fields inherited from class org.terrier.structures.BitPostingIndex
fieldCount, file, index, postingConstructor, postingImplementation
 
Constructor Summary
BlockInvertedIndex(Index index, java.lang.String structureName)
          Constructs an instance of the class with
BlockInvertedIndex(Index index, java.lang.String structureName, DocumentIndex doi)
          Constructs an instance of the class with
BlockInvertedIndex(Index index, java.lang.String structureName, DocumentIndex _doi, java.lang.Class<? extends IterablePosting> postingClass)
          Constructs an instance of the class with
 
Method Summary
 int[][] getDocuments(BitIndexPointer pointer)
          Returns a 2D array containing the document ids, the term frequencies, the field scores the block frequencies and the block ids for the given documents.
 void setIndex(Index i)
          let it know which index to use
 
Methods inherited from class org.terrier.structures.InvertedIndex
getBitFiles, getDocuments, getPostings, print
 
Methods inherited from class org.terrier.structures.BitPostingIndex
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DocumentBlockCountDelta

protected int DocumentBlockCountDelta
Constructor Detail

BlockInvertedIndex

public BlockInvertedIndex(Index index,
                          java.lang.String structureName,
                          DocumentIndex _doi,
                          java.lang.Class<? extends IterablePosting> postingClass)
                   throws java.io.IOException
Constructs an instance of the class with

Parameters:
index -
structureName -
_doi -
postingClass -
Throws:
java.io.IOException

BlockInvertedIndex

public BlockInvertedIndex(Index index,
                          java.lang.String structureName,
                          DocumentIndex doi)
                   throws java.io.IOException
Constructs an instance of the class with

Parameters:
index -
structureName -
doi -
Throws:
java.io.IOException

BlockInvertedIndex

public BlockInvertedIndex(Index index,
                          java.lang.String structureName)
                   throws java.io.IOException
Constructs an instance of the class with

Parameters:
index -
structureName -
Throws:
java.io.IOException
Method Detail

setIndex

public void setIndex(Index i)
let it know which index to use

Specified by:
setIndex in interface IndexConfigurable
Parameters:
i - Index object to use

getDocuments

public int[][] getDocuments(BitIndexPointer pointer)
Returns a 2D array containing the document ids, the term frequencies, the field scores the block frequencies and the block ids for the given documents.

Overrides:
getDocuments in class InvertedIndex
Parameters:
pointer - start byte and bit offset of the postings in the inverted file, together with number of postings to expect
Returns:
int[][] the five dimensional [5][] array containing the document ids, frequencies, field scores and block frequencies, while the last vector contains the block identifiers and it has a different length from the document identifiers.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow