Class ValueSource

    • Constructor Detail

      • ValueSource

        public ValueSource()
    • Method Detail

      • 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 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
      • newContext

        public static Map newContext​(IndexSearcher searcher)
        Returns a new non-threadsafe context map.
      • getSortField

        public SortField getSortField​(boolean reverse)
        EXPERIMENTAL: This method is subject to change.

        Get the SortField for this ValueSource. Uses the getValues(java.util.Map, AtomicReaderContext) to populate the SortField.

        Parameters:
        reverse - true if this is a reverse sort.
        Returns:
        The SortField for the ValueSource