Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures
Class BlockInvertedIndex

java.lang.Object
  extended by uk.ac.gla.terrier.structures.InvertedIndex
      extended by uk.ac.gla.terrier.structures.BlockInvertedIndex
All Implemented Interfaces:
Closeable, IndexConfigurable

public class BlockInvertedIndex
extends InvertedIndex
implements IndexConfigurable

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

Version:
$Revision: 1.32 $
Author:
Douglas Johnson

Field Summary
 
Fields inherited from class uk.ac.gla.terrier.structures.InvertedIndex
FIELD_LOAD_FACTOR, NORMAL_LOAD_FACTOR
 
Constructor Summary
BlockInvertedIndex(Lexicon lexicon)
          Creates an instance of the BlockInvertedIndex class using the given lexicon.
BlockInvertedIndex(Lexicon lexicon, java.lang.String filename)
          Creates an instance of the BlockInvertedIndex class using the given lexicon.
BlockInvertedIndex(Lexicon lexicon, java.lang.String path, java.lang.String prefix)
           
 
Method Summary
 int[][] getDocuments(int termid)
          Returns a two dimensional array containing the document ids, term frequencies and field scores for the given documents.
 int[][] getDocuments(long startOffset, byte startBitOffset, long endOffset, byte endBitOffset, int df)
          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.
 int[][] getDocumentsWithoutBlocks(int termid)
           
 int[][] getDocumentsWithoutBlocks(LexiconEntry lEntry)
           
 int[][] getDocumentsWithoutBlocks(long startOffset, byte startBitOffset, long endOffset, byte endBitOffset, int df)
           
 void print()
          Prints out the block inverted index file.
 void setIndex(Index i)
          let it know which index to use
 
Methods inherited from class uk.ac.gla.terrier.structures.InvertedIndex
close, getBitFile, getDocuments, getInfo, reOpenLegacyBitFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockInvertedIndex

public BlockInvertedIndex(Lexicon lexicon)
Creates an instance of the BlockInvertedIndex class using the given lexicon.

Parameters:
lexicon - The lexicon used for retrieval

BlockInvertedIndex

public BlockInvertedIndex(Lexicon lexicon,
                          java.lang.String path,
                          java.lang.String prefix)

BlockInvertedIndex

public BlockInvertedIndex(Lexicon lexicon,
                          java.lang.String filename)
Creates an instance of the BlockInvertedIndex class using the given lexicon.

Parameters:
lexicon - The lexicon used for retrieval
filename - the name of the inverted file
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

print

public void print()
Prints out the block inverted index file.

Overrides:
print in class InvertedIndex

getDocuments

public int[][] getDocuments(long startOffset,
                            byte startBitOffset,
                            long endOffset,
                            byte endBitOffset,
                            int df)
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:
startOffset - start byte of the postings in the inverted file
startBitOffset - start bit of the postings in the inverted file
endOffset - end byte of the postings in the inverted file
endBitOffset - end bit of the postings in the inverted file
df - the 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.

getDocuments

public int[][] getDocuments(int termid)
Description copied from class: InvertedIndex
Returns a two dimensional array containing the document ids, term frequencies and field scores for the given documents.

Overrides:
getDocuments in class InvertedIndex
Parameters:
termid - the identifier of the term whose documents we are looking for.
Returns:
int[][] the two dimensional [3][n] array containing the n document identifiers, frequencies and field scores. If fields is not enabled, then size is [2][n].

getDocumentsWithoutBlocks

public int[][] getDocumentsWithoutBlocks(int termid)

getDocumentsWithoutBlocks

public int[][] getDocumentsWithoutBlocks(LexiconEntry lEntry)

getDocumentsWithoutBlocks

public int[][] getDocumentsWithoutBlocks(long startOffset,
                                         byte startBitOffset,
                                         long endOffset,
                                         byte endBitOffset,
                                         int df)

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow