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 boolean
static MultiDoubleValuesSource
fromDoubleField
(String field) Creates a MultiDoubleValuesSource that wraps a double-valued fieldstatic MultiDoubleValuesSource
fromField
(String field, LongToDoubleFunction decoder) Creates a MultiDoubleValuesSource that wraps a generic NumericDocValues/SortedNumericDocValues field.static MultiDoubleValuesSource
fromFloatField
(String field) Creates a MultiDoubleValuesSource that wraps a float-valued fieldstatic MultiDoubleValuesSource
fromIntField
(String field) Creates a MultiDoubleValuesSource that wraps an int-valued fieldstatic MultiDoubleValuesSource
fromLongField
(String field) Creates a MultiDoubleValuesSource that wraps a long-valued fieldstatic MultiDoubleValuesSource
fromSingleValued
(DoubleValuesSource singleValued) Creates a MultiDoubleValuesSource that wraps a single-valuedDoubleValuesSource
abstract MultiDoubleValues
Returns aMultiDoubleValues
instance for the passed-in LeafReaderContextabstract int
hashCode()
final MultiLongValuesSource
Convert to a MultiLongValuesSource by casting the double values to longsfinal MultiLongValuesSource
Convert to aMultiLongValuesSource
usingNumericUtils.doubleToSortableLong(double)
abstract String
toString()
static DoubleValuesSource
Returns a single-valued view of theMultiDoubleValuesSource
if it was previously wrapped withfromSingleValued(DoubleValuesSource)
, or null.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.SegmentCacheable
isCacheable
-
Constructor Details
-
MultiDoubleValuesSource
public MultiDoubleValuesSource()Instantiates a new MultiDoubleValuesSource
-
-
Method Details
-
getValues
Returns aMultiDoubleValues
instance 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 indecoder
for 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 theMultiDoubleValuesSource
if it was previously wrapped withfromSingleValued(DoubleValuesSource)
, or null. -
toMultiLongValuesSource
Convert to a MultiLongValuesSource by casting the double values to longs -
toSortableMultiLongValuesSource
Convert to aMultiLongValuesSource
usingNumericUtils.doubleToSortableLong(double)
-