org.terrier.structures
Class InvertedIndex

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

public class InvertedIndex
extends BitPostingIndex

This class implements the inverted index for performing retrieval, with field information optionally.

Author:
Douglas Johnson, Vassilis Plachouras, Craig Macdonald

Field Summary
protected  DocumentIndex doi
           
static double FIELD_LOAD_FACTOR
          This is used during retrieval for a rough guess sizing of the temporaryTerms arraylist in getDocuments() - retrieval with Fields.
protected static org.apache.log4j.Logger logger
          The logger used for the Lexicon
static double NORMAL_LOAD_FACTOR
          This is used during retrieval for a rough guess sizing of the temporaryTerms arraylist in getDocuments().
 
Fields inherited from class org.terrier.structures.BitPostingIndex
fieldCount, file, index, postingConstructor, postingImplementation
 
Constructor Summary
InvertedIndex(Index index, java.lang.String structureName)
          Construct an instance of the class with
InvertedIndex(Index index, java.lang.String structureName, DocumentIndex _doi)
          Construct an instance of the class with
InvertedIndex(Index index, java.lang.String structureName, DocumentIndex _doi, java.lang.Class<? extends IterablePosting> postingClass)
          Construct an instance of the class with
 
Method Summary
 BitInSeekable[] getBitFiles()
          Get the BitFiles
 int[][] getDocuments(BitIndexPointer pointer)
          Get the documents for for the posting list using the pointer given
 int[][] getDocuments(LexiconEntry le)
          Get the documents for the specified term (lexicon entry for the term)
 IterablePosting getPostings(BitIndexPointer pointer)
          Get the posting given a pointer
 void print()
          Print out the Inverted Index
 
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

logger

protected static final org.apache.log4j.Logger logger
The logger used for the Lexicon


NORMAL_LOAD_FACTOR

public static final double NORMAL_LOAD_FACTOR
This is used during retrieval for a rough guess sizing of the temporaryTerms arraylist in getDocuments(). The higher this value, the less chance that the arraylist will have to be grown (growing is expensive), however more memory may be used unnecessarily.

See Also:
Constant Field Values

FIELD_LOAD_FACTOR

public static final double FIELD_LOAD_FACTOR
This is used during retrieval for a rough guess sizing of the temporaryTerms arraylist in getDocuments() - retrieval with Fields. The higher this value, the less chance that the arraylist will have to be grown (growing is expensive), however more memory may be used unnecessarily.

See Also:
Constant Field Values

doi

protected DocumentIndex doi
Constructor Detail

InvertedIndex

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

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

InvertedIndex

public InvertedIndex(Index index,
                     java.lang.String structureName,
                     DocumentIndex _doi)
              throws java.io.IOException
Construct an instance of the class with

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

InvertedIndex

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

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

getBitFiles

public BitInSeekable[] getBitFiles()
Get the BitFiles


print

public void print()
Print out the Inverted Index


getPostings

public IterablePosting getPostings(BitIndexPointer pointer)
                            throws java.io.IOException
Description copied from class: BitPostingIndex
Get the posting given a pointer

Specified by:
getPostings in interface PostingIndex<BitIndexPointer>
Overrides:
getPostings in class BitPostingIndex
Throws:
java.io.IOException

getDocuments

public int[][] getDocuments(LexiconEntry le)
Get the documents for the specified term (lexicon entry for the term)


getDocuments

public int[][] getDocuments(BitIndexPointer pointer)
Get the documents for for the posting list using the pointer given



Terrier 3.5. Copyright © 2004-2011 University of Glasgow