org.apache.lucene.search.function

Class FieldCacheSource

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.

Author: yonik

Constructor Summary
FieldCacheSource(String field)
Create a cached field source for the input field.
Method Summary
abstract booleancachedFieldSourceEquals(FieldCacheSource other)
Check if equals to another FieldCacheSource, already knowing that cache and field are equal.
abstract intcachedFieldSourceHashCode()
Return a hash code of a FieldCacheSource, without the hash-codes of the field and the cache (those are taken care of elsewhere).
Stringdescription()
booleanequals(Object o)
abstract DocValuesgetCachedFieldValues(FieldCache cache, String field, IndexReader reader)
Return cached DocValues for input field and reader.
DocValuesgetValues(IndexReader reader)
inthashCode()

Constructor Detail

FieldCacheSource

public FieldCacheSource(String field)
Create a cached field source for the input field.

Method Detail

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()

description

public String description()

equals

public final boolean equals(Object o)

getCachedFieldValues

public abstract DocValues getCachedFieldValues(FieldCache cache, String field, IndexReader reader)
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.

See Also: ValueSource

getValues

public final DocValues getValues(IndexReader reader)

hashCode

public final int hashCode()
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.