org.apache.solr.search.function
Class ValueSource

java.lang.Object
  extended by org.apache.solr.search.function.ValueSource
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConstValueSource, DualFloatFunction, FieldCacheSource, FileFloatSource, LinearFloatFunction, MaxFloatFunction, OrdFieldSource, ProductFloatFunction, QueryValueSource, RandomSortField.RandomValueSource, RangeMapFloatFunction, ReciprocalFloatFunction, ReverseOrdFieldSource, ScaleFloatFunction, SingleFunction, SumFloatFunction, TopValueSource

public abstract class ValueSource
extends Object
implements Serializable

Instantiates DocValues for a particular reader.
Often used when creating a FunctionQuery.

Version:
$Id: ValueSource.java 949467 2010-05-30 04:10:13Z hossman $
See Also:
Serialized Form

Constructor Summary
ValueSource()
           
 
Method Summary
 void createWeight(Map context, Searcher searcher)
          Implementations should propagate createWeight to sub-ValueSources which can optionally store weight info in the context.
abstract  String description()
          description of field, used in explain()
abstract  boolean equals(Object o)
           
 DocValues getValues(IndexReader reader)
          Deprecated. 
 DocValues getValues(Map context, IndexReader reader)
          Gets the values for this reader and the context that was previously passed to createWeight()
abstract  int hashCode()
           
static Map newContext()
          Returns a new non-threadsafe context map.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueSource

public ValueSource()
Method Detail

getValues

@Deprecated
public DocValues getValues(IndexReader reader)
                    throws IOException
Deprecated. 

Throws:
IOException

getValues

public DocValues getValues(Map context,
                           IndexReader reader)
                    throws IOException
Gets the values for this reader and the context that was previously passed to createWeight()

Throws:
IOException

equals

public abstract boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public abstract int hashCode()
Overrides:
hashCode in class Object

description

public abstract String description()
description of field, used in explain()


toString

public String toString()
Overrides:
toString in class Object

createWeight

public void createWeight(Map context,
                         Searcher searcher)
                  throws IOException
Implementations should propagate createWeight to sub-ValueSources which can optionally store weight info in the context. The context object will be passed to getValues() where this info can be retrieved.

Throws:
IOException

newContext

public static Map newContext()
Returns a new non-threadsafe context map.



Copyright © 2010 Apache Software Foundation. All Rights Reserved.