Class ValueSource

    • Constructor Detail

      • ValueSource

        public ValueSource()
    • Method Detail

      • getValues

        public abstract FunctionValues getValues​(Map<Object,​Object> context,
                                                 LeafReaderContext readerContext)
                                          throws IOException
        Gets the values for this reader and the context that was previously passed to createWeight(). The values must be consumed in a forward docID manner, and you must call this method again to iterate through the values again.
        Throws:
        IOException
      • equals

        public abstract boolean equals​(Object o)
        Overrides:
        equals in class Object
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class Object
      • description

        public abstract String description()
        description of field, used in explain()
      • createWeight

        public void createWeight​(Map<Object,​Object> context,
                                 IndexSearcher searcher)
                          throws IOException
        Implementations should propagate createWeight to sub-ValueSources which can optionally store weight info in the context. The context object will be passed to getValues() where this info can be retrieved.
        Throws:
        IOException
      • asLongValuesSource

        public LongValuesSource asLongValuesSource()
        Expose this ValueSource as a LongValuesSource
      • asDoubleValuesSource

        public DoubleValuesSource asDoubleValuesSource()
        Expose this ValueSource as a DoubleValuesSource