Class FileFloatSource

    • Constructor Detail

      • FileFloatSource

        public FileFloatSource​(SchemaField field,
                               SchemaField keyField,
                               float defVal,
                               String dataDir)
        Creates a new FileFloatSource
        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 org.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:
        getValues in class org.apache.lucene.queries.function.ValueSource
      • equals

        public boolean equals​(Object o)
        Specified by:
        equals in class org.apache.lucene.queries.function.ValueSource
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class org.apache.lucene.queries.function.ValueSource
      • toString

        public String toString()
        toString in class org.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.
        reader - the IndexReader whose cache needs refreshing