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.LongValuesSourceAn implementation ofLongValuesSourcefor docvalues with multiple values per document, where multiple values are "aggregated" into a single value according to a givenMultiValueMode.Some of this code was copied and adapted from
org.elasticsearch.search.MultiValueModefrom the Elasticsearch project.
-
-
Field Summary
Fields Modifier and Type Field Description protected MultiValueModemodeprotected NestedDocsProvidernestedDocsProvider
-
Constructor Summary
Constructors Constructor Description LongMultiValuesToSingleValuesSource(MultiValueMode mode, NestedDocsProvider nestedDocsProvider)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static LongMultiValuesToSingleValuesSourcefromIntField(String field, MultiValueMode mode, NestedDocsProvider nested)Creates aLongMultiValuesToSingleValuesSourcethat wraps an int-valued fieldstatic LongMultiValuesToSingleValuesSourcefromLongField(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, toString
-
-
-
-
Field Detail
-
mode
protected final MultiValueMode mode
-
nestedDocsProvider
protected final NestedDocsProvider nestedDocsProvider
-
-
Constructor Detail
-
LongMultiValuesToSingleValuesSource
public LongMultiValuesToSingleValuesSource(MultiValueMode mode, NestedDocsProvider nestedDocsProvider)
-
-
Method Detail
-
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
public boolean equals(Object o)
- 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 IOExceptionReturns 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)
-
-