Class LongMultiValuesToSingleValuesSource
java.lang.Object
org.apache.lucene.search.LongValuesSource
org.hibernate.search.backend.lucene.lowlevel.docvalues.impl.LongMultiValuesToSingleValuesSource
- All Implemented Interfaces:
org.apache.lucene.search.SegmentCacheable
public abstract class LongMultiValuesToSingleValuesSource
extends org.apache.lucene.search.LongValuesSource
An implementation of
LongValuesSource for docvalues with multiple values per document,
where multiple values are "aggregated" into a single value
according to a given MultiValueMode.
Some of this code was copied and adapted from
org.elasticsearch.search.MultiValueMode
from the Elasticsearch project.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.LongValuesSource
org.apache.lucene.search.LongValuesSource.ConstantLongValuesSource -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MultiValueModeprotected final NestedDocsProvider -
Constructor Summary
ConstructorsConstructorDescriptionLongMultiValuesToSingleValuesSource(MultiValueMode mode, NestedDocsProvider nestedDocsProvider) -
Method Summary
Modifier and TypeMethodDescriptionbooleanfromIntField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aLongMultiValuesToSingleValuesSourcethat wraps an int-valued fieldfromLongField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aLongMultiValuesToSingleValuesSourcethat wraps a long-valued fieldorg.apache.lucene.index.NumericDocValuesgetRawNumericDocValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) Returns aNumericDocValuesinstance for the passed-in LeafReaderContext and scores If scores are not needed to calculate the values (iereturns false, callers may safely passnullfor thescoresparameter.protected abstract org.apache.lucene.index.SortedNumericDocValuesgetSortedNumericDocValues(org.apache.lucene.index.LeafReaderContext ctx) org.apache.lucene.search.LongValuesgetValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) inthashCode()protected org.apache.lucene.search.LongValuesselect(org.apache.lucene.index.SortedNumericDocValues values) protected org.apache.lucene.search.LongValuesselect(org.apache.lucene.index.SortedNumericDocValues values, ChildDocIds childDocsWithValues) Methods inherited from class org.apache.lucene.search.LongValuesSource
constant, fromIntField, fromLongField, getSortField, needsScores, rewrite, toDoubleValuesSource, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.search.SegmentCacheable
isCacheable
-
Field Details
-
mode
-
nestedDocsProvider
-
-
Constructor Details
-
LongMultiValuesToSingleValuesSource
public LongMultiValuesToSingleValuesSource(MultiValueMode mode, NestedDocsProvider nestedDocsProvider)
-
-
Method Details
-
fromLongField
public static LongMultiValuesToSingleValuesSource fromLongField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aLongMultiValuesToSingleValuesSourcethat wraps a long-valued field- Parameters:
field- the fieldmode- the modenested- the nested provider- Returns:
- A
LongMultiValuesToSingleValuesSource
-
fromIntField
public static LongMultiValuesToSingleValuesSource fromIntField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aLongMultiValuesToSingleValuesSourcethat wraps an int-valued field- Parameters:
field- the fieldmode- the modenested- the nested provider- Returns:
- A
LongMultiValuesToSingleValuesSource
-
equals
- Specified by:
equalsin classorg.apache.lucene.search.LongValuesSource
-
hashCode
public int hashCode()- Specified by:
hashCodein classorg.apache.lucene.search.LongValuesSource
-
getValues
public org.apache.lucene.search.LongValues getValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) throws IOException - Specified by:
getValuesin classorg.apache.lucene.search.LongValuesSource- Throws:
IOException
-
getRawNumericDocValues
public org.apache.lucene.index.NumericDocValues getRawNumericDocValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) throws IOException Returns aNumericDocValuesinstance for the passed-in LeafReaderContext and scores If scores are not needed to calculate the values (iereturns false, callers may safely passnullfor thescoresparameter.- Parameters:
ctx- the ctxscores- the scores- Returns:
- NumericDocValues
- Throws:
IOException
-
getSortedNumericDocValues
protected abstract org.apache.lucene.index.SortedNumericDocValues getSortedNumericDocValues(org.apache.lucene.index.LeafReaderContext ctx) throws IOException - Throws:
IOException
-
select
protected org.apache.lucene.search.LongValues select(org.apache.lucene.index.SortedNumericDocValues values) -
select
protected org.apache.lucene.search.LongValues select(org.apache.lucene.index.SortedNumericDocValues values, ChildDocIds childDocsWithValues)
-