Package org.apache.solr.search.function
Class FileFloatSource
- java.lang.Object
-
- org.apache.lucene.queries.function.ValueSource
-
- org.apache.solr.search.function.FileFloatSource
-
public class FileFloatSource extends org.apache.lucene.queries.function.ValueSourceObtains float field values from an external file.- See Also:
ExternalFileField,ExternalFileFieldReloader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileFloatSource.ReloadCacheRequestHandler
-
Constructor Summary
Constructors Constructor Description FileFloatSource(SchemaField field, SchemaField keyField, float defVal, String dataDir)Creates a new FileFloatSource
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdescription()booleanequals(Object o)org.apache.lucene.queries.function.FunctionValuesgetValues(Map<Object,Object> context, org.apache.lucene.index.LeafReaderContext readerContext)inthashCode()voidrefreshCache(org.apache.lucene.index.IndexReader reader)Refresh the cache for an IndexReader.static voidresetCache()Remove all cached entries.StringtoString()
-
-
-
Constructor Detail
-
FileFloatSource
public FileFloatSource(SchemaField field, SchemaField keyField, float defVal, String dataDir)
Creates a new FileFloatSource- Parameters:
field- the source's SchemaFieldkeyField- the field to use as a keydefVal- the default value to use if a field has no entry in the external filedataDir- the directory in which to look for the external file
-
-
Method Detail
-
description
public String description()
- Specified by:
descriptionin classorg.apache.lucene.queries.function.ValueSource
-
getValues
public org.apache.lucene.queries.function.FunctionValues getValues(Map<Object,Object> context, org.apache.lucene.index.LeafReaderContext readerContext) throws IOException
- Specified by:
getValuesin classorg.apache.lucene.queries.function.ValueSource- Throws:
IOException
-
equals
public boolean equals(Object o)
- Specified by:
equalsin classorg.apache.lucene.queries.function.ValueSource
-
hashCode
public int hashCode()
- Specified by:
hashCodein classorg.apache.lucene.queries.function.ValueSource
-
toString
public String toString()
- Overrides:
toStringin classorg.apache.lucene.queries.function.ValueSource
-
resetCache
public static void resetCache()
Remove all cached entries. Values are lazily loaded next time getValues() is called.
-
refreshCache
public void refreshCache(org.apache.lucene.index.IndexReader reader)
Refresh the cache for an IndexReader. The new values are loaded in the background and then swapped in, so queries against the cache should not block while the reload is happening.- Parameters:
reader- the IndexReader whose cache needs refreshing
-
-