Class MultiLongValuesSource
- All Implemented Interfaces:
SegmentCacheable
MultiLongValues. See also LongValuesSource for a
single-valued version.
MultiLongValuesSource objects for long and int-valued NumericDocValues/SortedNumericDocValues
fields can be obtained by calling fromLongField(String) and fromIntField(String). This is valid for both multi-valued and single-valued fields.
To obtain a MultiLongValuesSource from a float or double-valued
NumericDocValues/SortedNumericDocValues field, use MultiDoubleValuesSource.fromFloatField(String) or MultiDoubleValuesSource.fromDoubleField(String) and then call MultiDoubleValuesSource.toMultiLongValuesSource().
To obtain a MultiLongValuesSource from an existing LongValuesSource, see fromSingleValued(LongValuesSource). Instances created in this way can be "unwrapped" using
unwrapSingleton(MultiLongValuesSource) if necessary. Note that scores are never provided
to the underlying LongValuesSource. LongValuesSource.rewrite(IndexSearcher) will
also never be called. The user should be aware of this if using a LongValuesSource 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 MultiLongValuesSourcefromIntField(String field) Creates a MultiLongValuesSource that wraps an int-valued fieldstatic MultiLongValuesSourcefromLongField(String field) Creates a MultiLongValuesSource that wraps a long-valued fieldstatic MultiLongValuesSourcefromSingleValued(LongValuesSource singleValued) Creates a MultiLongValuesSource that wraps a single-valuedLongValuesSourceabstract MultiLongValuesReturns aMultiLongValuesinstance for the passed-in LeafReaderContextabstract inthashCode()final MultiDoubleValuesSourceConvert to a MultiDoubleValuesSource by casting long values to doublesabstract StringtoString()static LongValuesSourceReturns a single-valued view of theMultiLongValuesSourceif it was previously wrapped withfromSingleValued(LongValuesSource), 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
-
MultiLongValuesSource
public MultiLongValuesSource()Instantiates a new MultiLongValuesSource
-
-
Method Details
-
getValues
Returns aMultiLongValuesinstance for the passed-in LeafReaderContext- Throws:
IOException
-
hashCode
public abstract int hashCode() -
equals
-
toString
-
fromLongField
Creates a MultiLongValuesSource that wraps a long-valued field -
fromIntField
Creates a MultiLongValuesSource that wraps an int-valued field -
fromSingleValued
Creates a MultiLongValuesSource that wraps a single-valuedLongValuesSource -
unwrapSingleton
Returns a single-valued view of theMultiLongValuesSourceif it was previously wrapped withfromSingleValued(LongValuesSource), or null. -
toMultiDoubleValuesSource
Convert to a MultiDoubleValuesSource by casting long values to doubles
-