Class DoubleMultiValuesToSingleValuesSource
java.lang.Object
org.apache.lucene.search.DoubleValuesSource
org.hibernate.search.backend.lucene.lowlevel.docvalues.impl.DoubleMultiValuesToSingleValuesSource
- All Implemented Interfaces:
org.apache.lucene.search.SegmentCacheable
- Direct Known Subclasses:
GeoPointDistanceMultiValuesToSingleValuesSource
public abstract class DoubleMultiValuesToSingleValuesSource
extends org.apache.lucene.search.DoubleValuesSource
An implementation of
DoubleValuesSource 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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MultiValueModeprotected final NestedDocsProviderFields inherited from class org.apache.lucene.search.DoubleValuesSource
SCORES -
Constructor Summary
ConstructorsConstructorDescriptionDoubleMultiValuesToSingleValuesSource(MultiValueMode mode, NestedDocsProvider nestedDocsProvider) -
Method Summary
Modifier and TypeMethodDescriptionbooleanfromDoubleField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aDoubleMultiValuesToSingleValuesSourcethat wraps a double-valued fieldfromFloatField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aDoubleMultiValuesToSingleValuesSourcethat wraps a float-valued fieldprotected abstract SortedNumericDoubleDocValuesgetSortedNumericDoubleDocValues(org.apache.lucene.index.LeafReaderContext ctx) getValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) inthashCode()protected NumericDoubleValuesselect(SortedNumericDoubleDocValues values) protected NumericDoubleValuesselect(SortedNumericDoubleDocValues values, ChildDocIds childDocsWithValues) Methods inherited from class org.apache.lucene.search.DoubleValuesSource
constant, explain, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, needsScores, rewrite, similarityToQueryVector, similarityToQueryVector, toLongValuesSource, 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
-
DoubleMultiValuesToSingleValuesSource
public DoubleMultiValuesToSingleValuesSource(MultiValueMode mode, NestedDocsProvider nestedDocsProvider)
-
-
Method Details
-
fromDoubleField
public static DoubleMultiValuesToSingleValuesSource fromDoubleField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aDoubleMultiValuesToSingleValuesSourcethat wraps a double-valued field- Parameters:
field- the fieldmode- the modenested- the nested provider- Returns:
- A
DoubleMultiValuesToSingleValuesSource
-
fromFloatField
public static DoubleMultiValuesToSingleValuesSource fromFloatField(String field, MultiValueMode mode, NestedDocsProvider nested) Creates aDoubleMultiValuesToSingleValuesSourcethat wraps a float-valued field- Parameters:
field- the fieldmode- the modenested- the nested provider- Returns:
- A
DoubleMultiValuesToSingleValuesSource
-
equals
- Specified by:
equalsin classorg.apache.lucene.search.DoubleValuesSource
-
hashCode
public int hashCode()- Specified by:
hashCodein classorg.apache.lucene.search.DoubleValuesSource
-
getValues
public NumericDoubleValues getValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) throws IOException - Specified by:
getValuesin classorg.apache.lucene.search.DoubleValuesSource- Throws:
IOException
-
getSortedNumericDoubleDocValues
protected abstract SortedNumericDoubleDocValues getSortedNumericDoubleDocValues(org.apache.lucene.index.LeafReaderContext ctx) throws IOException - Throws:
IOException
-
select
-
select
protected NumericDoubleValues select(SortedNumericDoubleDocValues values, ChildDocIds childDocsWithValues)
-