Package com.yahoo.prelude.query
Class RangeItem
- java.lang.Object
-
- All Implemented Interfaces:
BlockItem
,HasIndexItem
,IndexedItem
,TaggableItem
,java.lang.Cloneable
public class RangeItem extends IntItem
This class represents a numeric range. You can also specify the number of hits you want this range to produce, which can be used to create more efficient searches. Note that '0' as hit limit means all hits matching the range criterion will be a match, while positive numbers start from 'from' working its way towards 'to' until it has reached its limit or range is exhausted. Negative number means that it will start from 'to' and work its way towards 'from'.- Author:
- baldersheim, bratseth
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType
-
-
Field Summary
-
Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
-
-
Constructor Summary
Constructors Constructor Description RangeItem(Limit from, Limit to, int hitLimit, java.lang.String indexName, boolean isFromQuery)
RangeItem(Limit from, Limit to, java.lang.String indexName)
Creates a new range operatorRangeItem(Limit from, Limit to, java.lang.String indexName, boolean isFromQuery)
Creates a new range operatorRangeItem(java.lang.Number from, java.lang.Number to, int hitLimit, java.lang.String indexName, boolean isFromQuery)
RangeItem(java.lang.Number from, java.lang.Number to, java.lang.String indexName)
Creates a new range operatorRangeItem(java.lang.Number from, java.lang.Number to, java.lang.String indexName, boolean isFromQuery)
Creates a new range operator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Number
getFrom()
Returns the lower limit of this range, which may be negative infinityjava.lang.Number
getTo()
Returns the upper limit of this range, which may be positive infinity-
Methods inherited from class com.yahoo.prelude.query.IntItem
appendHeadingString, encodeThis, equals, from, getEncodedInt, getFromLimit, getHitLimit, getIndexedString, getItemType, getName, getNumber, getNumWords, getRawWord, getToLimit, hashCode, isStemmed, isWords, setHitLimit, setNumber, setValue, stringValue
-
Methods inherited from class com.yahoo.prelude.query.TermItem
appendBodyString, disclose, encode, getOrigin, getSegmentingRule, getTermCount, isFromQuery, isNormalizable, setNormalizable, setOrigin, setSegmentingRule
-
Methods inherited from class com.yahoo.prelude.query.SimpleIndexedItem
appendIndexString, getIndexName, setIndexName
-
Methods inherited from class com.yahoo.prelude.query.SimpleTaggableItem
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
-
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, clone, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthize, toString, usePositionData
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.yahoo.prelude.query.HasIndexItem
getIndexName
-
-
-
-
Constructor Detail
-
RangeItem
public RangeItem(java.lang.Number from, java.lang.Number to, java.lang.String indexName)
Creates a new range operator- Parameters:
from
- inclusive start point for rangeto
- inclusive end point for rangeindexName
- the index to search for this range
-
RangeItem
public RangeItem(Limit from, Limit to, java.lang.String indexName)
Creates a new range operator- Parameters:
from
- start point for rangeto
- end point for rangeindexName
- the index to search for this range
-
RangeItem
public RangeItem(java.lang.Number from, java.lang.Number to, java.lang.String indexName, boolean isFromQuery)
Creates a new range operator- Parameters:
from
- inclusive start point for rangeto
- inclusive end point for rangeindexName
- the index to search for this rangeisFromQuery
- Indicate if this stems directly from the user given query, or if you have constructed it at will.
-
RangeItem
public RangeItem(Limit from, Limit to, java.lang.String indexName, boolean isFromQuery)
Creates a new range operator- Parameters:
from
- start point for rangeto
- end point for rangeindexName
- the index to search for this rangeisFromQuery
- Indicate if this stems directly from the user given query, or if you have constructed it at will.
-
RangeItem
public RangeItem(java.lang.Number from, java.lang.Number to, int hitLimit, java.lang.String indexName, boolean isFromQuery)
- Parameters:
from
- inclusive start point for rangeto
- inclusive end point for rangehitLimit
- This tells how many results you want included from this range as a minimum. You might get less if there are not enough, or you might get more. It will use the dictionary and include enough entries to satisfy your request. Positive number will start from left (@from) and work right. Negative number will start from right and work its way left. 0 means no limit.indexName
- the index to search for this rangeisFromQuery
- Indicate if this stems directly from the user given query, or if you have constructed it at will.
-
RangeItem
public RangeItem(Limit from, Limit to, int hitLimit, java.lang.String indexName, boolean isFromQuery)
- Parameters:
from
- start point for rangeto
- end point for rangehitLimit
- This tells how many results you want included from this range as a minimum. You might get less if there are not enough, or you might get more. It will use the dictionary and include enough entries to satisfy your request. Positive number will start from left (@from) and work right. Negative number will start from right and work its way left. 0 means no limit.indexName
- the index to search for this rangeisFromQuery
- Indicate if this stems directly from the user given query, or if you have constructed it at will.
-
-