Class SquaredEuclideanFunction
- java.lang.Object
-
- org.apache.lucene.queries.function.ValueSource
-
- org.apache.solr.search.function.distance.VectorDistanceFunction
-
- org.apache.solr.search.function.distance.SquaredEuclideanFunction
-
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
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringname-
Fields inherited from class org.apache.solr.search.function.distance.VectorDistanceFunction
oneOverPower, power, source1, source2
-
-
Constructor Summary
Constructors Constructor Description SquaredEuclideanFunction(org.apache.lucene.queries.function.valuesource.MultiValueSource source1, org.apache.lucene.queries.function.valuesource.MultiValueSource source2)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doubledistance(int doc, org.apache.lucene.queries.function.FunctionValues dv1, org.apache.lucene.queries.function.FunctionValues dv2)Calculate the distancebooleanequals(Object o)inthashCode()protected Stringname()-
Methods inherited from class org.apache.solr.search.function.distance.VectorDistanceFunction
createWeight, description, distSquaredCartesian, getValues, vectorDistance, vectorDistance
-
-
-
-
Field Detail
-
name
protected String name
-
-
Method Detail
-
name
protected String name()
- Overrides:
namein classVectorDistanceFunction
-
distance
protected double distance(int doc, org.apache.lucene.queries.function.FunctionValues dv1, org.apache.lucene.queries.function.FunctionValues dv2) throws IOExceptionDescription copied from class:VectorDistanceFunctionCalculate the distance- Overrides:
distancein classVectorDistanceFunction- Parameters:
doc- The doc to scoredv1- The values from the first MultiValueSourcedv2- The values from the second MultiValueSource- Returns:
- The distance
- Throws:
IOException
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classVectorDistanceFunction
-
hashCode
public int hashCode()
- Overrides:
hashCodein classVectorDistanceFunction
-
-