Documentation of 'org.apache.lucene.search.function.FieldCacheSource' Java class
FieldCacheSource
org.apache.lucene.search.function

Class FieldCacheSource

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    ByteFieldSource, FloatFieldSource, IntFieldSource, ShortFieldSource


    public abstract class FieldCacheSource
    extends ValueSource
    Expert: A base class for ValueSource implementations that retrieve values for a single field from the FieldCache.

    Fields used herein nust be indexed (doesn't matter if these fields are stored or not).

    It is assumed that each such indexed field is untokenized, or at least has a single token in a document. For documents with multiple tokens of the same field, behavior is undefined (It is likely that current code would use the value of one of these tokens, but this is not guaranteed).

    Document with no tokens in this field are assigned the Zero value.

    WARNING: The status of the search.function package is experimental. The APIs introduced here might change in the future and will not be supported anymore in such a case.

    See Also:
    Serialized Form
    • Constructor Detail

      • FieldCacheSource

        public FieldCacheSource(java.lang.String field)
        Create a cached field source for the input field.
    • Method Detail

      • getValues

        public final DocValues getValues(IndexReader reader)
                                  throws java.io.IOException
        Description copied from class: ValueSource
        Return the DocValues used by the function query.
        Specified by:
        getValues in class ValueSource
        Parameters:
        reader - the IndexReader used to read these values. If any caching is involved, that caching would also be IndexReader based.
        Throws:
        java.io.IOException - for any error.
      • description

        public java.lang.String description()
        Description copied from class: ValueSource
        description of field, used in explain()
        Specified by:
        description in class ValueSource
      • getCachedFieldValues

        public abstract DocValues getCachedFieldValues(FieldCache cache,
                                                       java.lang.String field,
                                                       IndexReader reader)
                                                throws java.io.IOException
        Return cached DocValues for input field and reader.
        Parameters:
        cache - FieldCache so that values of a field are loaded once per reader (RAM allowing)
        field - Field for which values are required.
        Throws:
        java.io.IOException
        See Also:
        ValueSource
      • cachedFieldSourceEquals

        public abstract boolean cachedFieldSourceEquals(FieldCacheSource other)
        Check if equals to another FieldCacheSource, already knowing that cache and field are equal.
        See Also:
        Object.equals(java.lang.Object)
      • cachedFieldSourceHashCode

        public abstract int cachedFieldSourceHashCode()
        Return a hash code of a FieldCacheSource, without the hash-codes of the field and the cache (those are taken care of elsewhere).
        See Also:
        Object.hashCode()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.