com.sun.labs.minion.retrieval
Class QuickOr

java.lang.Object
  extended by com.sun.labs.minion.retrieval.QuickOr
Direct Known Subclasses:
ScoredQuickOr

public class QuickOr
extends java.lang.Object


Field Summary
protected  int added
          The number of sets of postings that have been added.
protected  int[] docs
          The documents that we're storing.
protected  int p
          The number of unique documents that we're storing.
protected  DiskPartition part
          The partition for which we're holding documents.
 
Constructor Summary
QuickOr(DiskPartition part, int estSize)
           
 
Method Summary
 void add(int[] d, float[] w, float qw)
          Adds an explicit set of documents and weights to this quick or.
 void add(PostingsIterator pi)
           
 void add(PostingsIterator pi, float fw)
           
 void addWeightOnly(float qw)
          Adds only a weight to this QuickOr.
 ArrayGroup getGroup()
           
 void setQueryStats(QueryStats qs)
           
protected  boolean shouldStoreAll(DiskPartition part, int estSize)
          Decide whether we should store weights for all documents in a partition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

part

protected DiskPartition part
The partition for which we're holding documents.


docs

protected int[] docs
The documents that we're storing.


p

protected int p
The number of unique documents that we're storing.


added

protected int added
The number of sets of postings that have been added.

Constructor Detail

QuickOr

public QuickOr(DiskPartition part,
               int estSize)
Method Detail

shouldStoreAll

protected boolean shouldStoreAll(DiskPartition part,
                                 int estSize)
Decide whether we should store weights for all documents in a partition. We will do so if the number of documents in the partition is less than 50,000 or if the estimated size of the results set is more than 90% of the number of documents in the partition.


setQueryStats

public void setQueryStats(QueryStats qs)

add

public void add(PostingsIterator pi)

add

public void add(PostingsIterator pi,
                float fw)

add

public void add(int[] d,
                float[] w,
                float qw)
Adds an explicit set of documents and weights to this quick or.

Parameters:
d - the documents to add
w - the weights associated with the documents
qw - a weight associated with a query term, which will be multiplied against the weights in the array.

addWeightOnly

public void addWeightOnly(float qw)
Adds only a weight to this QuickOr. This allows for document representations where not all terms from a document appear in the partition that this QuickOr corresponds to. We still want those terms' weights to be accounted for.

Parameters:
qw - the query weight of a term to add to this QuickOr

getGroup

public ArrayGroup getGroup()