public enum MultiValueMode extends java.lang.Enum<MultiValueMode> implements Writeable
Modifier and Type | Class and Description |
---|---|
static interface |
MultiValueMode.UnsortedNumericDoubleValues
Interface allowing custom value generators to be used in MultiValueMode.
|
Writeable.Reader<V>, Writeable.Writer<V>
Enum Constant and Description |
---|
AVG
Pick the average of all the values.
|
MAX
Pick the highest value.
|
MEDIAN
Pick the median of the values.
|
MIN
Pick the lowest value.
|
SUM
Pick the sum of all the values.
|
Modifier and Type | Method and Description |
---|---|
static MultiValueMode |
fromString(java.lang.String sortMode)
A case insensitive version of
valueOf(String) |
protected org.apache.lucene.util.BytesRef |
pick(org.apache.lucene.index.BinaryDocValues values,
org.apache.lucene.util.BytesRefBuilder builder,
org.apache.lucene.search.DocIdSetIterator docItr,
int startDoc,
int endDoc) |
protected double |
pick(MultiValueMode.UnsortedNumericDoubleValues values,
double missingValue,
int doc) |
protected int |
pick(org.apache.lucene.index.RandomAccessOrds values,
int doc) |
protected org.apache.lucene.util.BytesRef |
pick(SortedBinaryDocValues values,
org.apache.lucene.util.BytesRef missingValue,
int doc) |
protected int |
pick(org.apache.lucene.index.SortedDocValues values,
org.apache.lucene.search.DocIdSetIterator docItr,
int startDoc,
int endDoc) |
protected long |
pick(org.apache.lucene.index.SortedNumericDocValues values,
long missingValue,
org.apache.lucene.search.DocIdSetIterator docItr,
int startDoc,
int endDoc) |
protected long |
pick(org.apache.lucene.index.SortedNumericDocValues values,
long missingValue,
int doc) |
protected double |
pick(SortedNumericDoubleValues values,
double missingValue,
org.apache.lucene.search.DocIdSetIterator docItr,
int startDoc,
int endDoc) |
protected double |
pick(SortedNumericDoubleValues values,
double missingValue,
int doc) |
static MultiValueMode |
readMultiValueModeFrom(StreamInput in) |
NumericDoubleValues |
select(MultiValueMode.UnsortedNumericDoubleValues values,
double missingValue)
Return a
NumericDoubleValues instance that can be used to sort documents
with this mode and the provided values. |
org.apache.lucene.index.SortedDocValues |
select(org.apache.lucene.index.RandomAccessOrds values)
Return a
SortedDocValues instance that can be used to sort documents
with this mode and the provided values. |
org.apache.lucene.index.SortedDocValues |
select(org.apache.lucene.index.RandomAccessOrds values,
org.apache.lucene.util.BitSet rootDocs,
org.apache.lucene.search.DocIdSetIterator innerDocs)
Return a
SortedDocValues instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents. |
org.apache.lucene.index.BinaryDocValues |
select(SortedBinaryDocValues values,
org.apache.lucene.util.BytesRef missingValue)
Return a
BinaryDocValues instance that can be used to sort documents
with this mode and the provided values. |
org.apache.lucene.index.BinaryDocValues |
select(SortedBinaryDocValues values,
org.apache.lucene.util.BytesRef missingValue,
org.apache.lucene.util.BitSet rootDocs,
org.apache.lucene.search.DocIdSetIterator innerDocs,
int maxDoc)
Return a
BinaryDocValues instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents. |
org.apache.lucene.index.NumericDocValues |
select(org.apache.lucene.index.SortedNumericDocValues values,
long missingValue)
Return a
NumericDocValues instance that can be used to sort documents
with this mode and the provided values. |
org.apache.lucene.index.NumericDocValues |
select(org.apache.lucene.index.SortedNumericDocValues values,
long missingValue,
org.apache.lucene.util.BitSet rootDocs,
org.apache.lucene.search.DocIdSetIterator innerDocs,
int maxDoc)
Return a
NumericDocValues instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents. |
NumericDoubleValues |
select(SortedNumericDoubleValues values,
double missingValue)
Return a
NumericDoubleValues instance that can be used to sort documents
with this mode and the provided values. |
NumericDoubleValues |
select(SortedNumericDoubleValues values,
double missingValue,
org.apache.lucene.util.BitSet rootDocs,
org.apache.lucene.search.DocIdSetIterator innerDocs,
int maxDoc)
Return a
NumericDoubleValues instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents. |
static MultiValueMode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MultiValueMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
public static final MultiValueMode SUM
public static final MultiValueMode AVG
public static final MultiValueMode MEDIAN
public static final MultiValueMode MIN
public static final MultiValueMode MAX
public static MultiValueMode[] values()
for (MultiValueMode c : MultiValueMode.values()) System.out.println(c);
public static MultiValueMode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static MultiValueMode fromString(java.lang.String sortMode)
valueOf(String)
java.lang.IllegalArgumentException
- if the given string doesn't match a sort mode or is null
.public org.apache.lucene.index.NumericDocValues select(org.apache.lucene.index.SortedNumericDocValues values, long missingValue)
NumericDocValues
instance that can be used to sort documents
with this mode and the provided values. When a document has no value,
missingValue
is returned.
Allowed Modes: SUM, AVG, MEDIAN, MIN, MAXprotected long pick(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, int doc)
public org.apache.lucene.index.NumericDocValues select(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, org.apache.lucene.util.BitSet rootDocs, org.apache.lucene.search.DocIdSetIterator innerDocs, int maxDoc) throws java.io.IOException
NumericDocValues
instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents.
For every root document, the values of its inner documents will be aggregated.
If none of the inner documents has a value, then missingValue
is returned.
Allowed Modes: SUM, AVG, MIN, MAX
NOTE: Calling the returned instance on docs that are not root docs is illegal
The returned instance can only be evaluate the current and upcoming docsjava.io.IOException
protected long pick(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc)
public NumericDoubleValues select(SortedNumericDoubleValues values, double missingValue)
NumericDoubleValues
instance that can be used to sort documents
with this mode and the provided values. When a document has no value,
missingValue
is returned.
Allowed Modes: SUM, AVG, MEDIAN, MIN, MAXprotected double pick(SortedNumericDoubleValues values, double missingValue, int doc)
public NumericDoubleValues select(SortedNumericDoubleValues values, double missingValue, org.apache.lucene.util.BitSet rootDocs, org.apache.lucene.search.DocIdSetIterator innerDocs, int maxDoc) throws java.io.IOException
NumericDoubleValues
instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents.
For every root document, the values of its inner documents will be aggregated.
If none of the inner documents has a value, then missingValue
is returned.
Allowed Modes: SUM, AVG, MIN, MAX
NOTE: Calling the returned instance on docs that are not root docs is illegal
The returned instance can only be evaluate the current and upcoming docsjava.io.IOException
protected double pick(SortedNumericDoubleValues values, double missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc)
public org.apache.lucene.index.BinaryDocValues select(SortedBinaryDocValues values, org.apache.lucene.util.BytesRef missingValue)
BinaryDocValues
instance that can be used to sort documents
with this mode and the provided values. When a document has no value,
missingValue
is returned.
Allowed Modes: MIN, MAXprotected org.apache.lucene.util.BytesRef pick(SortedBinaryDocValues values, org.apache.lucene.util.BytesRef missingValue, int doc)
public org.apache.lucene.index.BinaryDocValues select(SortedBinaryDocValues values, org.apache.lucene.util.BytesRef missingValue, org.apache.lucene.util.BitSet rootDocs, org.apache.lucene.search.DocIdSetIterator innerDocs, int maxDoc) throws java.io.IOException
BinaryDocValues
instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents.
For every root document, the values of its inner documents will be aggregated.
If none of the inner documents has a value, then missingValue
is returned.
Allowed Modes: MIN, MAX
NOTE: Calling the returned instance on docs that are not root docs is illegal
The returned instance can only be evaluate the current and upcoming docsjava.io.IOException
protected org.apache.lucene.util.BytesRef pick(org.apache.lucene.index.BinaryDocValues values, org.apache.lucene.util.BytesRefBuilder builder, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc)
public org.apache.lucene.index.SortedDocValues select(org.apache.lucene.index.RandomAccessOrds values)
SortedDocValues
instance that can be used to sort documents
with this mode and the provided values.
Allowed Modes: MIN, MAXprotected int pick(org.apache.lucene.index.RandomAccessOrds values, int doc)
public org.apache.lucene.index.SortedDocValues select(org.apache.lucene.index.RandomAccessOrds values, org.apache.lucene.util.BitSet rootDocs, org.apache.lucene.search.DocIdSetIterator innerDocs) throws java.io.IOException
SortedDocValues
instance that can be used to sort root documents
with this mode, the provided values and filters for root/inner documents.
For every root document, the values of its inner documents will be aggregated.
Allowed Modes: MIN, MAX
NOTE: Calling the returned instance on docs that are not root docs is illegal
The returned instance can only be evaluate the current and upcoming docsjava.io.IOException
protected int pick(org.apache.lucene.index.SortedDocValues values, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc)
public NumericDoubleValues select(MultiValueMode.UnsortedNumericDoubleValues values, double missingValue)
NumericDoubleValues
instance that can be used to sort documents
with this mode and the provided values. When a document has no value,
missingValue
is returned.
Allowed Modes: SUM, AVG, MIN, MAXprotected double pick(MultiValueMode.UnsortedNumericDoubleValues values, double missingValue, int doc)
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public static MultiValueMode readMultiValueModeFrom(StreamInput in) throws java.io.IOException
java.io.IOException