Package org.elasticsearch.search
Enum Class MultiValueMode
- All Implemented Interfaces:
Serializable,Comparable<MultiValueMode>,Constable,Writeable
Defines what values to pick in the case a document contains multiple values for a particular field.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiValueModefromString(String sortMode)A case insensitive version ofvalueOf(String)protected org.apache.lucene.util.BytesRefpick(org.apache.lucene.index.BinaryDocValues values, org.apache.lucene.util.BytesRefBuilder builder, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren)protected intpick(org.apache.lucene.index.SortedDocValues values, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren)protected longpick(org.apache.lucene.index.SortedNumericDocValues values)protected longpick(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren)protected intpick(org.apache.lucene.index.SortedSetDocValues values)protected org.apache.lucene.util.BytesRefpick(SortedBinaryDocValues values)protected doublepick(SortedNumericDoubleValues values)protected doublepick(SortedNumericDoubleValues values, double missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren)static MultiValueModeorg.apache.lucene.index.NumericDocValuesselect(org.apache.lucene.index.SortedNumericDocValues values)Return aNumericDocValuesinstance that can be used to sort documents with this mode and the provided values.org.apache.lucene.index.NumericDocValuesselect(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren)Return aNumericDocValuesinstance that can be used to sort root documents with this mode, the provided values and filters for root/inner documents.org.apache.lucene.index.SortedDocValuesselect(org.apache.lucene.index.SortedSetDocValues values)Return aSortedDocValuesinstance that can be used to sort documents with this mode and the provided values.org.apache.lucene.index.SortedDocValuesselect(org.apache.lucene.index.SortedSetDocValues values, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxChildren)Return aSortedDocValuesinstance that can be used to sort root documents with this mode, the provided values and filters for root/inner documents.org.apache.lucene.index.BinaryDocValuesselect(SortedBinaryDocValues values, org.apache.lucene.util.BytesRef missingValue)Return aBinaryDocValuesinstance that can be used to sort documents with this mode and the provided values.org.apache.lucene.index.BinaryDocValuesselect(SortedBinaryDocValues values, org.apache.lucene.util.BytesRef missingValue, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren)Return aBinaryDocValuesinstance that can be used to sort root documents with this mode, the provided values and filters for root/inner documents.select(SortedNumericDoubleValues values)Return aNumericDoubleValuesinstance that can be used to sort documents with this mode and the provided values.select(SortedNumericDoubleValues values, double missingValue, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren)Return aNumericDoubleValuesinstance that can be used to sort root documents with this mode, the provided values and filters for root/inner documents.static MultiValueModeReturns the enum constant of this class with the specified name.static MultiValueMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.voidwriteTo(StreamOutput out)Write this into the StreamOutput.
-
Enum Constant Details
-
SUM
Pick the sum of all the values. -
AVG
Pick the average of all the values. -
MEDIAN
Pick the median of the values. -
MIN
Pick the lowest value. -
MAX
Pick the highest value.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromString
A case insensitive version ofvalueOf(String)- Throws:
IllegalArgumentException- if the given string doesn't match a sort mode or isnull.
-
select
public org.apache.lucene.index.NumericDocValues select(org.apache.lucene.index.SortedNumericDocValues values)Return aNumericDocValuesinstance that can be used to sort documents with this mode and the provided values. When a document has no value,missingValueis returned. Allowed Modes: SUM, AVG, MEDIAN, MIN, MAX -
pick
- Throws:
IOException
-
select
public org.apache.lucene.index.NumericDocValues select(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOExceptionReturn aNumericDocValuesinstance 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, thenmissingValueis 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 docs- Throws:
IOException
-
pick
protected long pick(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException- Throws:
IOException
-
select
Return aNumericDoubleValuesinstance that can be used to sort documents with this mode and the provided values. When a document has no value,missingValueis returned. Allowed Modes: SUM, AVG, MEDIAN, MIN, MAX -
pick
- Throws:
IOException
-
select
public NumericDoubleValues select(SortedNumericDoubleValues values, double missingValue, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOExceptionReturn aNumericDoubleValuesinstance 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, thenmissingValueis 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 docs- Throws:
IOException
-
pick
protected double pick(SortedNumericDoubleValues values, double missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException- Throws:
IOException
-
select
public org.apache.lucene.index.BinaryDocValues select(SortedBinaryDocValues values, org.apache.lucene.util.BytesRef missingValue)Return aBinaryDocValuesinstance that can be used to sort documents with this mode and the provided values. When a document has no value,missingValueis returned. Allowed Modes: MIN, MAX -
pick
- Throws:
IOException
-
select
public org.apache.lucene.index.BinaryDocValues select(SortedBinaryDocValues values, org.apache.lucene.util.BytesRef missingValue, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOExceptionReturn aBinaryDocValuesinstance 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, thenmissingValueis 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 docs- Throws:
IOException
-
pick
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, int maxChildren) throws IOException- Throws:
IOException
-
select
public org.apache.lucene.index.SortedDocValues select(org.apache.lucene.index.SortedSetDocValues values)Return aSortedDocValuesinstance that can be used to sort documents with this mode and the provided values. Allowed Modes: MIN, MAX -
pick
- Throws:
IOException
-
select
public org.apache.lucene.index.SortedDocValues select(org.apache.lucene.index.SortedSetDocValues values, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxChildren) throws IOExceptionReturn aSortedDocValuesinstance 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 docs- Throws:
IOException
-
pick
protected int pick(org.apache.lucene.index.SortedDocValues values, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren) throws IOException- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
readMultiValueModeFrom
- Throws:
IOException
-