org.apache.lucene.search.function
Class FieldCacheSource
- java.lang.Object
-
- org.apache.lucene.search.function.ValueSource
-
- org.apache.lucene.search.function.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 theFieldCache.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
Zerovalue.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 Summary
Constructors Constructor and Description FieldCacheSource(java.lang.String field)Create a cached field source for the input field.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract booleancachedFieldSourceEquals(FieldCacheSource other)Check if equals to anotherFieldCacheSource, already knowing that cache and field are equal.abstract intcachedFieldSourceHashCode()Return a hash code of aFieldCacheSource, without the hash-codes of the field and the cache (those are taken care of elsewhere).java.lang.Stringdescription()description of field, used in explain()booleanequals(java.lang.Object o)Needed for possible caching of query results - used byValueSourceQuery.equals(Object).abstract DocValuesgetCachedFieldValues(FieldCache cache, java.lang.String field, IndexReader reader)Return cached DocValues for input field and reader.DocValuesgetValues(IndexReader reader)Return the DocValues used by the function query.inthashCode()Needed for possible caching of query results - used byValueSourceQuery.hashCode().-
Methods inherited from class org.apache.lucene.search.function.ValueSource
toString
-
-
-
-
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:ValueSourceReturn the DocValues used by the function query.- Specified by:
getValuesin classValueSource- 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:ValueSourcedescription of field, used in explain()- Specified by:
descriptionin classValueSource
-
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
-
equals
public final boolean equals(java.lang.Object o)
Description copied from class:ValueSourceNeeded for possible caching of query results - used byValueSourceQuery.equals(Object).- Specified by:
equalsin classValueSource- See Also:
Object.equals(Object)
-
hashCode
public final int hashCode()
Description copied from class:ValueSourceNeeded for possible caching of query results - used byValueSourceQuery.hashCode().- Specified by:
hashCodein classValueSource- See Also:
Object.hashCode()
-
cachedFieldSourceEquals
public abstract boolean cachedFieldSourceEquals(FieldCacheSource other)
Check if equals to anotherFieldCacheSource, 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 aFieldCacheSource, 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