org.apache.solr.search.function
Class ReciprocalFloatFunction
java.lang.Object
org.apache.solr.search.function.ValueSource
org.apache.solr.search.function.ReciprocalFloatFunction
- All Implemented Interfaces:
- Serializable
public class ReciprocalFloatFunction
- extends ValueSource
ReciprocalFloatFunction
implements a reciprocal function f(x) = a/(mx+b), based on
the float value of a field as exported by ValueSource
.
When a and b are equal, and x>=0, this function has a maximum value of 1 that drops as x increases.
Increasing the value of a and b together results in a movement of the entire function to a flatter part of the curve.
These properties make this an idea function for boosting more recent documents.
Example:ReciprocalFloatFunction(new ReverseOrdFieldSource("my_date"),1,1000,1000)
- Version:
- $Id: ReciprocalFloatFunction.java 472574 2006-11-08 18:25:52Z yonik $
- Author:
- yonik
- See Also:
FunctionQuery
,
Serialized Form
source
protected final ValueSource source
m
protected final float m
a
protected final float a
b
protected final float b
ReciprocalFloatFunction
public ReciprocalFloatFunction(ValueSource source,
float m,
float a,
float b)
- f(source) = a/(m*float(source)+b)
getValues
public DocValues getValues(IndexReader reader)
throws IOException
- Specified by:
getValues
in class ValueSource
- Throws:
IOException
description
public String description()
- Description copied from class:
ValueSource
- description of field, used in explain()
- Specified by:
description
in class ValueSource
hashCode
public int hashCode()
- Specified by:
hashCode
in class ValueSource
equals
public boolean equals(Object o)
- Specified by:
equals
in class ValueSource
Copyright © 2006 - 2009 The Apache Software Foundation