com.sun.labs.minion.indexer.postings
Class PostingsIteratorFeatures

java.lang.Object
  extended by com.sun.labs.minion.indexer.postings.PostingsIteratorFeatures
All Implemented Interfaces:
java.lang.Cloneable

public class PostingsIteratorFeatures
extends java.lang.Object
implements java.lang.Cloneable

A set of features that can be used to configure various aspects of a postings iterator.


Field Summary
protected  boolean caseSensitive
          Whether the iterator will return postings for case-sensitive or case insensitive variations.
protected  int[] fields
          The fields that we want to return postings for.
protected  float[] mult
          The multipliers that we wish to apply to scores from certain fields.
protected  boolean positions
          Whether the iterator must be able to return positions.
protected  QueryStats qs
           
protected  WeightingComponents wc
          A set of weighting components that can be used when calculating term weights.
protected  WeightingFunction wf
          The weighting function that the iterator will use to calculate weights.
 
Constructor Summary
PostingsIteratorFeatures()
          Creates a default set of features.
PostingsIteratorFeatures(WeightingFunction wf, WeightingComponents wc)
          Creates a set of features.
PostingsIteratorFeatures(WeightingFunction wf, WeightingComponents wc, int[] fields, float[] mult, boolean positions, boolean caseSensitive)
          Creates a set of features.
 
Method Summary
 java.lang.Object clone()
          Clones this set of features.
 boolean getCaseSensitive()
          Gets the required case sensitivity for the postings.
 int[] getFields()
          Gets the fields that we're currently using.
 float[] getMult()
          Gets the field multipliers that we're currently using.
 boolean getPositions()
          Gets whether this set of features requires that iterators be able to return positions.
 QueryStats getQueryStats()
           
 WeightingComponents getWeightingComponents()
          Gets the weighting components to be used by iterators.
 WeightingFunction getWeightingFunction()
          Gets the weighting function to be used by iterators.
 void setCaseSensitive(boolean caseSensitive)
          Sets the case sensitiveness of the postings.
 void setFields(int[] fields)
          Sets the fields that we should use.
 void setFields(java.lang.String[] fields, InvFileDiskPartition dp)
          Sets the fields that we should use.
 void setMult(float[] mult)
          Sets the fied multipliers that we should be using.
 void setMult(java.util.Map mult, InvFileDiskPartition dp)
          Sets the field multipliers that we should be using.
 void setPositions(boolean positions)
          Sets the value of the positions.
 void setQueryStats(QueryStats qs)
           
 void setWeightingComponents(WeightingComponents wc)
          Sets the weighting components to be used by iterators.
 void setWeightingFunction(WeightingFunction wf)
          Sets the weighting function to be used by iterators.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

qs

protected QueryStats qs

wf

protected WeightingFunction wf
The weighting function that the iterator will use to calculate weights.


wc

protected WeightingComponents wc
A set of weighting components that can be used when calculating term weights.


fields

protected int[] fields
The fields that we want to return postings for. If the ith element of this array is greater than zero, then the iterator will return postings for the field whose ID is i. If element 0 of the array is greater than zero, then postings that are not in any field will be returned.


mult

protected float[] mult
The multipliers that we wish to apply to scores from certain fields. The value in the ith position indicates the weight that will be used to multiply the score of a term that has occurrences in the field whose ID is i. If this array is null, then no multipliers will be applied.


positions

protected boolean positions
Whether the iterator must be able to return positions. If true, then the iterator must be capable of returning positions.


caseSensitive

protected boolean caseSensitive
Whether the iterator will return postings for case-sensitive or case insensitive variations.

Constructor Detail

PostingsIteratorFeatures

public PostingsIteratorFeatures()
Creates a default set of features.


PostingsIteratorFeatures

public PostingsIteratorFeatures(WeightingFunction wf,
                                WeightingComponents wc)
Creates a set of features.

Parameters:
wf - A weighting function to use for these postings. If null, no weighting function will be used.
wc - a collection of components that can be used when calculating weighting functions.

PostingsIteratorFeatures

public PostingsIteratorFeatures(WeightingFunction wf,
                                WeightingComponents wc,
                                int[] fields,
                                float[] mult,
                                boolean positions,
                                boolean caseSensitive)
Creates a set of features.

Parameters:
wf - A weighting function to use for these postings. If null, no weighting function will be used.
wc - a collection of components that can be used when calculating weighting functions.
fields - If the ith element of this field is greater than zero, then the iterator will return postings for the field whose ID is i. If element 0 of the array is greater than zero, then postings that are not in any field will be returned.
mult - An array of floats indicating the field IDs for which we want to apply multipliers. The value in the ith position indicates the weight that will be used to multiply the score of a term that has occurrences in the field whose ID is i. If this array is null, then no multipliers will be applied.
positions - if true, then iterators created using this set of features must be able to return positions.
caseSensitive - if true then the iterator that is returned will be for case sensitive postings. If false then the iterator that is returned will be for case insensitive postings.
Method Detail

setWeightingFunction

public void setWeightingFunction(WeightingFunction wf)
Sets the weighting function to be used by iterators.


getWeightingFunction

public WeightingFunction getWeightingFunction()
Gets the weighting function to be used by iterators.


setWeightingComponents

public void setWeightingComponents(WeightingComponents wc)
Sets the weighting components to be used by iterators.


getWeightingComponents

public WeightingComponents getWeightingComponents()
Gets the weighting components to be used by iterators.


setQueryStats

public void setQueryStats(QueryStats qs)

getQueryStats

public QueryStats getQueryStats()

setPositions

public void setPositions(boolean positions)
Sets the value of the positions.

Parameters:
positions - if true, then iterators created using this set of features must be able to return positions.

getPositions

public boolean getPositions()
Gets whether this set of features requires that iterators be able to return positions.


setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)
Sets the case sensitiveness of the postings.

Parameters:
caseSensitive - if true, postings will be returned for case sensitive instances of an entry in a dictionary.

getCaseSensitive

public boolean getCaseSensitive()
Gets the required case sensitivity for the postings.


setFields

public void setFields(int[] fields)
Sets the fields that we should use.


setFields

public void setFields(java.lang.String[] fields,
                      InvFileDiskPartition dp)
Sets the fields that we should use.

Parameters:
fields - The names of the fields of interest.
dp - A partition that we can use to map field names to field IDs.

getFields

public int[] getFields()
Gets the fields that we're currently using.


setMult

public void setMult(float[] mult)
Sets the fied multipliers that we should be using.


setMult

public void setMult(java.util.Map mult,
                    InvFileDiskPartition dp)
Sets the field multipliers that we should be using.

Parameters:
mult - A map from field names to multiplier values.
dp - A partition that we can use to map field names to field IDs.

getMult

public float[] getMult()
Gets the field multipliers that we're currently using.


clone

public java.lang.Object clone()
Clones this set of features.

Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object