org.apache.solr.search.function.distance
Class SquaredEuclideanFunction
java.lang.Object
org.apache.solr.search.function.ValueSource
org.apache.solr.search.function.distance.VectorDistanceFunction
org.apache.solr.search.function.distance.SquaredEuclideanFunction
- All Implemented Interfaces:
- Serializable
public class SquaredEuclideanFunction
- extends VectorDistanceFunction
While not strictly a distance, the Sq. Euclidean Distance is often all that is needed in many applications
that require a distance, thus saving a sq. rt. calculation
- See Also:
- Serialized Form
name
protected String name
SquaredEuclideanFunction
public SquaredEuclideanFunction(MultiValueSource source1,
MultiValueSource source2)
name
protected String name()
- Overrides:
name
in class VectorDistanceFunction
distance
protected double distance(int doc,
DocValues dv1,
DocValues dv2)
- Description copied from class:
VectorDistanceFunction
- Calculate the distance
- Overrides:
distance
in class VectorDistanceFunction
- Parameters:
doc
- The doc to scoredv1
- The values from the first MultiValueSourcedv2
- The values from the second MultiValueSource
- Returns:
- The distance
equals
public boolean equals(Object o)
- Overrides:
equals
in class VectorDistanceFunction
hashCode
public int hashCode()
- Overrides:
hashCode
in class VectorDistanceFunction