Class IntervalFacets.FacetInterval

    • Constructor Detail

      • FacetInterval

        public FacetInterval(SchemaField schemaField,
                             String startStr,
                             String endStr,
                             boolean includeLower,
                             boolean includeUpper,
                             String key)
        Constructor that accepts already parsed values of start and end. This constructor can only be used with numeric field types.
        schemaField - schemaField for this range
        startStr - String representation of the start value of this interval. Can be a "*".
        endStr - String representation of the end value of this interval. Can be a "*".
        includeLower - Indicates weather this interval should include values equal to start
        includeUpper - Indicates weather this interval should include values equal to end
        key - String key of this interval
    • Method Detail

      • includes

        public org.apache.solr.request.IntervalFacets.IntervalCompareResult includes(long value)
        Method to use to check whether a document should be counted for an interval or not. Before calling this method on a multi-valued and/or non-numeric field make sure you call updateContext(SortedDocValues) or updateContext(SortedSetDocValues) (depending on the DV type). It is OK to call this method without other previous calls on numeric fields (with NumericDocValues)
        value - For numeric single value fields, this value should be the long representation of the value of the document in the specified field. For multi-valued and/or non-numeric fields, value should be the ordinal of the term in the current segment
        • IntervalCompareResult#INCLUDED if the value is included in the interval
        • IntervalCompareResult#GREATER_THAN_END if the value is greater than endLimit
        • IntervalCompareResult#LOWER_THAN_START if the value is lower than startLimit
        See Also:
        NumericUtils.floatToSortableInt(float), NumericUtils.doubleToSortableLong(double)
      • getCount

        public int getCount()
        The count of document that matched this interval
      • getKey

        public String getKey()
        Human readable key for this interval