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 ValueSource

  Obtains float field values from an external file.
  See Also:
    `ExternalFileField`, `ExternalFileFieldReloader`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FileFloatSource.ReloadCacheRequestHandler`

  - ### Constructor Summary

    Constructors
    Constructor and 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 and Description
    --- | ---
    `String` | `description()`
    `boolean` | `equals(Object o)`
    `FunctionValues` | `getValues(Map context, LeafReaderContext readerContext)`
    `int` | `hashCode()`
    `void` | `refreshCache(IndexReader reader)` Refresh the cache for an IndexReader.
    `static void` | `resetCache()` Remove all cached entries.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.lucene.queries.function.ValueSource

      `createWeight, getSortField, newContext`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### FileFloatSource

          public FileFloatSource(SchemaField field,
                                 SchemaField keyField,
                                 float defVal,
                                 String datadir)

      Creates a new FileFloatSource
      Parameters:
        `field` - the source's SchemaField
        `keyField` - the field to use as a key
        `defVal` - the default value to use if a field has no entry in the external file
        `datadir` - the directory in which to look for the external file

  - ### Method Detail

    - #### description

          public String description()

      Specified by:
        `description` in class `ValueSource`

    - #### getValues

          public FunctionValues getValues(Map context,
                                          LeafReaderContext readerContext)
                                   throws IOException

      Specified by:
        `getValues` in class `ValueSource`
      Throws:
        `IOException`

    - #### equals

          public boolean equals(Object o)

      Specified by:
        `equals` in class `ValueSource`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `ValueSource`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `ValueSource`

    - #### resetCache

          public static void resetCache()

      Remove all cached entries. Values are lazily loaded next time getValues() is called.

    - #### refreshCache

          public void refreshCache(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

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.