Class FloatFieldSource
- java.lang.Object
-
- org.apache.lucene.search.function.ValueSource
-
- org.apache.lucene.search.function.FieldCacheSource
-
- org.apache.lucene.search.function.FloatFieldSource
-
- All Implemented Interfaces:
Serializable
public class FloatFieldSource extends FieldCacheSource
Expert: obtains float field values from theFieldCacheusinggetFloats()and makes those values available as other numeric types, casting as needed.- See Also:
for requirements on the field. NOTE: with the switch in 2.9 to segment-based searching, if 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., Serialized Form- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description FloatFieldSource(String field)Create a cached float field source with default string-to-float parser.FloatFieldSource(String field, FieldCache.FloatParser parser)Create a cached float field source with a specific string-to-float parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancachedFieldSourceEquals(FieldCacheSource o)Check if equals to anotherFieldCacheSource, already knowing that cache and field are equal.intcachedFieldSourceHashCode()Return a hash code of aFieldCacheSource, without the hash-codes of the field and the cache (those are taken care of elsewhere).Stringdescription()description of field, used in explain()DocValuesgetCachedFieldValues(FieldCache cache, String field, IndexReader reader)Return cached DocValues for input field and reader.-
Methods inherited from class org.apache.lucene.search.function.FieldCacheSource
equals, getValues, hashCode
-
Methods inherited from class org.apache.lucene.search.function.ValueSource
toString
-
-
-
-
Constructor Detail
-
FloatFieldSource
public FloatFieldSource(String field)
Create a cached float field source with default string-to-float parser.
-
FloatFieldSource
public FloatFieldSource(String field, FieldCache.FloatParser parser)
Create a cached float field source with a specific string-to-float parser.
-
-
Method Detail
-
description
public String description()
Description copied from class:ValueSourcedescription of field, used in explain()- Overrides:
descriptionin classFieldCacheSource
-
getCachedFieldValues
public DocValues getCachedFieldValues(FieldCache cache, String field, IndexReader reader) throws IOException
Description copied from class:FieldCacheSourceReturn cached DocValues for input field and reader.- Specified by:
getCachedFieldValuesin classFieldCacheSource- Parameters:
cache- FieldCache so that values of a field are loaded once per reader (RAM allowing)field- Field for which values are required.- Throws:
IOException- See Also:
ValueSource
-
cachedFieldSourceEquals
public boolean cachedFieldSourceEquals(FieldCacheSource o)
Description copied from class:FieldCacheSourceCheck if equals to anotherFieldCacheSource, already knowing that cache and field are equal.- Specified by:
cachedFieldSourceEqualsin classFieldCacheSource- See Also:
Object.equals(java.lang.Object)
-
cachedFieldSourceHashCode
public int cachedFieldSourceHashCode()
Description copied from class:FieldCacheSourceReturn a hash code of aFieldCacheSource, without the hash-codes of the field and the cache (those are taken care of elsewhere).- Specified by:
cachedFieldSourceHashCodein classFieldCacheSource- See Also:
Object.hashCode()
-
-