Enum MultiValueMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MultiValueMode>, java.lang.constant.Constable, Writeable

    public enum MultiValueMode
    extends java.lang.Enum<MultiValueMode>
    implements 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

        java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant 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.
    • Method Summary

      Modifier and Type Method 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, int maxChildren)  
      protected int pick​(org.apache.lucene.index.SortedDocValues values, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren)  
      protected long pick​(org.apache.lucene.index.SortedNumericDocValues values)  
      protected long pick​(org.apache.lucene.index.SortedNumericDocValues values, long missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren)  
      protected int pick​(org.apache.lucene.index.SortedSetDocValues values)  
      protected org.apache.lucene.util.BytesRef pick​(SortedBinaryDocValues values)  
      protected double pick​(SortedNumericDoubleValues values)  
      protected double pick​(SortedNumericDoubleValues values, double missingValue, org.apache.lucene.search.DocIdSetIterator docItr, int startDoc, int endDoc, int maxChildren)  
      static MultiValueMode readMultiValueModeFrom​(StreamInput in)  
      org.apache.lucene.index.NumericDocValues select​(org.apache.lucene.index.SortedNumericDocValues values)
      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 parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren)
      Return a NumericDocValues 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.SortedDocValues select​(org.apache.lucene.index.SortedSetDocValues 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.SortedSetDocValues values, org.apache.lucene.util.BitSet parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxChildren)
      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 parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren)
      Return a BinaryDocValues 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)
      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 parentDocs, org.apache.lucene.search.DocIdSetIterator childDocs, int maxDoc, int maxChildren)
      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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • SUM

        public static final MultiValueMode SUM
        Pick the sum of all the values.
      • AVG

        public static final MultiValueMode AVG
        Pick the average of all the values.
      • MEDIAN

        public static final MultiValueMode MEDIAN
        Pick the median of the values.
    • Method Detail

      • values

        public static MultiValueMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared.
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MultiValueMode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromString

        public static MultiValueMode fromString​(java.lang.String sortMode)
        A case insensitive version of valueOf(String)
        Throws:
        java.lang.IllegalArgumentException - if the given string doesn't match a sort mode or is null.
      • select

        public org.apache.lucene.index.NumericDocValues select​(org.apache.lucene.index.SortedNumericDocValues values)
        Return a 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, MAX
      • pick

        protected long pick​(org.apache.lucene.index.SortedNumericDocValues values)
                     throws java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Return a 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 docs
        Throws:
        java.io.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 java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Return a 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 docs
        Throws:
        java.io.IOException
      • pick

        protected double pick​(SortedNumericDoubleValues values,
                              double missingValue,
                              org.apache.lucene.search.DocIdSetIterator docItr,
                              int startDoc,
                              int endDoc,
                              int maxChildren)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • select

        public 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. When a document has no value, missingValue is returned. Allowed Modes: MIN, MAX
      • pick

        protected org.apache.lucene.util.BytesRef pick​(SortedBinaryDocValues values)
                                                throws java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Return a 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 docs
        Throws:
        java.io.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 java.io.IOException
        Throws:
        java.io.IOException
      • select

        public org.apache.lucene.index.SortedDocValues select​(org.apache.lucene.index.SortedSetDocValues values)
        Return a SortedDocValues instance that can be used to sort documents with this mode and the provided values. Allowed Modes: MIN, MAX
      • pick

        protected int pick​(org.apache.lucene.index.SortedSetDocValues values)
                    throws java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Return a 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 docs
        Throws:
        java.io.IOException
      • pick

        protected int pick​(org.apache.lucene.index.SortedDocValues values,
                           org.apache.lucene.search.DocIdSetIterator docItr,
                           int startDoc,
                           int endDoc,
                           int maxChildren)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • readMultiValueModeFrom

        public static MultiValueMode readMultiValueModeFrom​(StreamInput in)
                                                     throws java.io.IOException
        Throws:
        java.io.IOException