Class MultiDoubleValuesSource
- All Implemented Interfaces:
SegmentCacheable
MultiDoubleValues. See also DoubleValuesSource for a
single-valued version.
MultiDoubleValuesSource objects for NumericDocValues/SortedNumericDocValues fields can be
obtained by calling fromFloatField(String), fromDoubleField(String), fromIntField(String), or fromLongField(String). If custom long-to-double logic is
required, fromField(String, LongToDoubleFunction) can be used. This is valid for both
multi-valued and single-valued fields.
To obtain a MultiDoubleValuesSource from an existing DoubleValuesSource, see fromSingleValued(DoubleValuesSource). Instances created in this way can be "unwrapped" using
unwrapSingleton(MultiDoubleValuesSource) if necessary. Note that scores are never
provided to the underlying DoubleValuesSource. DoubleValuesSource.rewrite(IndexSearcher) will also never be called. The user should be aware of
this if using a DoubleValuesSource that relies on rewriting or scores. The faceting
use-cases don't call rewrite or provide scores, which is why this simplification was made.
Currently meant only for use within the faceting module. Could be further generalized and made available for more use-cases outside faceting if there is a desire to do so.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanstatic MultiDoubleValuesSourcefromDoubleField(String field) Creates a MultiDoubleValuesSource that wraps a double-valued fieldstatic MultiDoubleValuesSourcefromField(String field, LongToDoubleFunction decoder) Creates a MultiDoubleValuesSource that wraps a generic NumericDocValues/SortedNumericDocValues field.static MultiDoubleValuesSourcefromFloatField(String field) Creates a MultiDoubleValuesSource that wraps a float-valued fieldstatic MultiDoubleValuesSourcefromIntField(String field) Creates a MultiDoubleValuesSource that wraps an int-valued fieldstatic MultiDoubleValuesSourcefromLongField(String field) Creates a MultiDoubleValuesSource that wraps a long-valued fieldstatic MultiDoubleValuesSourcefromSingleValued(DoubleValuesSource singleValued) Creates a MultiDoubleValuesSource that wraps a single-valuedDoubleValuesSourceabstract MultiDoubleValuesReturns aMultiDoubleValuesinstance for the passed-in LeafReaderContextabstract inthashCode()final MultiLongValuesSourceConvert to a MultiLongValuesSource by casting the double values to longsfinal MultiLongValuesSourceConvert to aMultiLongValuesSourceusingNumericUtils.doubleToSortableLong(double)abstract StringtoString()static DoubleValuesSourceReturns a single-valued view of theMultiDoubleValuesSourceif it was previously wrapped withfromSingleValued(DoubleValuesSource), or null.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.search.SegmentCacheable
isCacheable
-
Constructor Details
-
MultiDoubleValuesSource
public MultiDoubleValuesSource()Instantiates a new MultiDoubleValuesSource
-
-
Method Details
-
getValues
Returns aMultiDoubleValuesinstance for the passed-in LeafReaderContext- Throws:
IOException
-
hashCode
public abstract int hashCode() -
equals
-
toString
-
fromField
Creates a MultiDoubleValuesSource that wraps a generic NumericDocValues/SortedNumericDocValues field. Uses the long-to-double decoding logic specified indecoderfor converting the stored value to a double. -
fromDoubleField
Creates a MultiDoubleValuesSource that wraps a double-valued field -
fromFloatField
Creates a MultiDoubleValuesSource that wraps a float-valued field -
fromLongField
Creates a MultiDoubleValuesSource that wraps a long-valued field -
fromIntField
Creates a MultiDoubleValuesSource that wraps an int-valued field -
fromSingleValued
Creates a MultiDoubleValuesSource that wraps a single-valuedDoubleValuesSource -
unwrapSingleton
Returns a single-valued view of theMultiDoubleValuesSourceif it was previously wrapped withfromSingleValued(DoubleValuesSource), or null. -
toMultiLongValuesSource
Convert to a MultiLongValuesSource by casting the double values to longs -
toSortableMultiLongValuesSource
Convert to aMultiLongValuesSourceusingNumericUtils.doubleToSortableLong(double)
-