|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.retrieval.QueryElement com.sun.labs.minion.retrieval.QueryTerm com.sun.labs.minion.retrieval.FieldTerm
public class FieldTerm
A class to hold a term generated by a single parametric field
operator. It should be used in cases where there is a single operation
on a single field. When there are overlapping operations on a single
field (e.g., num >= 1 <and> num < 25
), the
RangeFieldTerm
should be used.
Field Summary | |
---|---|
protected static long |
dayMilliSeconds
|
protected CDateParser |
dp
A date parser for date fields. |
protected boolean |
includeLower
Lower bound is inclusive? |
protected boolean |
includeUpper
Upper bound is inclusive? |
protected DictionaryIterator |
iter
An iterator that will produce terms from the dictionary associated with this saved field. |
protected static java.lang.String |
logTag
|
protected java.lang.Object |
lowerBound
For range queries, this is the lower bound on the range. |
protected java.lang.String |
name
The name of the field that is begin operated on. |
protected Relation.Operator |
op
The parametric operator, as defined in the relation class. |
protected PostingsIterator |
pi
The postings for a a single term pulled from the dictionary associated with this saved field. |
protected boolean |
selectRange
This should be true if this FieldTerm was constructed with range data. |
protected java.lang.Object |
upperBound
For range queries, this is the upper bound on the range. |
protected java.lang.String |
val
The value given in the query. |
Fields inherited from class com.sun.labs.minion.retrieval.QueryTerm |
---|
doExpand, doMorph, doStem, doWild, loadPositions, matchCase |
Fields inherited from class com.sun.labs.minion.retrieval.QueryElement |
---|
estSize, fieldMultipliers, inOrder, keepPositions, order, part, qc, qs, searchFieldNames, searchFields, strictEval, wc, wf |
Constructor Summary | |
---|---|
FieldTerm(java.lang.String name,
java.lang.Object lowerBound,
boolean includeLower,
java.lang.Object upperBound,
boolean includeUpper)
Construct a field term with a specific range of valid values. |
|
FieldTerm(java.lang.String name,
Relation.Operator op,
java.lang.String val)
Creates a field term. |
Method Summary | |
---|---|
protected int |
calculateEstimatedSize()
Estimates the size of the results set for the given term. |
ArrayGroup |
eval(ArrayGroup ag)
Evaluates the term in the current partition. |
java.lang.String |
getName()
|
Relation.Operator |
getOp()
|
java.util.List |
getQueryTerms(java.util.Comparator c)
Returns a list of all the regular terms in this query in the order that they appeared in the query. |
java.lang.Object |
getValue()
Gets the value of this field term, if it is not a range operation. |
protected static boolean |
isDayResolution(java.util.Date d)
Checks whether a given date has a day-level resolution. |
void |
setPartition(DiskPartition part)
Sets the current partition, and makes sure that we have valid search field and multiplier arrays for this partition. |
java.lang.String |
toString(java.lang.String prefix)
|
Methods inherited from class com.sun.labs.minion.retrieval.QueryTerm |
---|
setDoExpand, setDoMorph, setDoStem, setDoWild, setLoadPositions, setMatchCase, setQueryConfig |
Methods inherited from class com.sun.labs.minion.retrieval.QueryElement |
---|
addSearchFieldName, compareTo, dump, estimateSize, getInOrder, getOrder, getQueryStats, getQueryTerms, getSearchFieldNames, setInOrder, setOrder, setQueryStats, setSearchFields, setWeightingComponents, setWeightingFunction, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected Relation.Operator op
protected java.lang.String val
protected CDateParser dp
protected java.lang.Object lowerBound
protected boolean includeLower
protected java.lang.Object upperBound
protected boolean includeUpper
protected DictionaryIterator iter
protected PostingsIterator pi
protected boolean selectRange
protected static java.lang.String logTag
protected static long dayMilliSeconds
Constructor Detail |
---|
public FieldTerm(java.lang.String name, Relation.Operator op, java.lang.String val)
name
- The name of the field that we're operating on.op
- The operator that we're using.val
- The value to compare against, given in the query.public FieldTerm(java.lang.String name, java.lang.Object lowerBound, boolean includeLower, java.lang.Object upperBound, boolean includeUpper)
name
- the name of the field to operate onlowerBound
- the lower bound on the rangeincludeLower
- true if the lower bound is inclusiveupperBound
- the upper bound on the rangeincludeUpper
- true if the upper bound is inclusiveMethod Detail |
---|
public java.lang.String getName()
public Relation.Operator getOp()
public java.lang.Object getValue()
public void setPartition(DiskPartition part)
QueryElement
setPartition
in class QueryElement
protected static boolean isDayResolution(java.util.Date d)
protected int calculateEstimatedSize()
calculateEstimatedSize
in class QueryElement
public ArrayGroup eval(ArrayGroup ag)
eval
in class QueryTerm
ag
- An array group that we can use to limit the evaluation of
the term. If this group is null
a new group will be
returned. If this group is non-null
, then the elements
in the group will be used to restrict the documents that we return
from the term.
ArrayGroup
containing the results of
evaluating the term against the given group. We will return an
instance of StrictGroup
, since there are no weights
associated with the values.public java.util.List getQueryTerms(java.util.Comparator c)
QueryElement
getQueryTerms
in class QueryElement
c
- A comparator used to order the terms.public java.lang.String toString(java.lang.String prefix)
toString
in class QueryTerm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |