Home » lucene-3.0.1-src » org.apache » lucene » search » function » [javadoc | source]
abstract public class: FieldCacheSource [javadoc | source]

All Implemented Interfaces:

Direct Known Subclasses:
    FloatFieldSource, ShortFieldSource, IntFieldSource, ByteFieldSource

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

Fields used herein must 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.

NOTE: with the switch in 2.9 to segment-based searching, if #getValues is invoked with a composite (multi-segment) reader, this can easily cause double RAM usage for the values in the FieldCache. It's best to switch your application to pass only atomic (single segment) readers to this API.

 public FieldCacheSource(String field) 
    Create a cached field source for the input field.
Method from org.apache.lucene.search.function.FieldCacheSource Summary:
cachedFieldSourceEquals,   cachedFieldSourceHashCode,   description,   equals,   getCachedFieldValues,   getValues,   hashCode
Methods from org.apache.lucene.search.function.ValueSource:
description,   equals,   getValues,   hashCode,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.function.FieldCacheSource Detail:
 abstract public boolean cachedFieldSourceEquals(FieldCacheSource other)
    Check if equals to another FieldCacheSource , already knowing that cache and field are equal.
 abstract public 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).
 public String description() 
 public final boolean equals(Object o) 
 abstract public DocValues getCachedFieldValues(FieldCache cache,
    String field,
    IndexReader reader) throws IOException
    Return cached DocValues for input field and reader.
 public final DocValues getValues(IndexReader reader) throws IOException 
 public final int hashCode()