Class RangeItem

  • 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
    • 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 range
        to - inclusive end point for range
        indexName - 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 range
        to - end point for range
        indexName - 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 range
        to - inclusive end point for range
        indexName - the index to search for this range
        isFromQuery - 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 range
        to - end point for range
        indexName - the index to search for this range
        isFromQuery - 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 range
        to - inclusive end point for range
        hitLimit - 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 range
        isFromQuery - 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 range
        to - end point for range
        hitLimit - 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 range
        isFromQuery - Indicate if this stems directly from the user given query, or if you have constructed it at will.
    • Method Detail

      • getFrom

        public final java.lang.Number getFrom()
        Returns the lower limit of this range, which may be negative infinity
      • getTo

        public final java.lang.Number getTo()
        Returns the upper limit of this range, which may be positive infinity