SquaredEuclideanFunction (Solr 3.6.2 API)
Keywords: org.apache.solr.search.function.distance.SquaredEuclideanFunction class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Field Summary
`protected String` | `name`

Fields inherited from class org.apache.solr.search.function.distance.VectorDistanceFunction
`oneOverPower, power, source1, source2`

Constructor Summary
`SquaredEuclideanFunction(MultiValueSource source1, MultiValueSource source2)`

Method Summary
`protected double` | `distance(int doc, DocValues dv1, DocValues dv2)` Calculate the distance
`boolean` | `equals(Object o)`
`int` | `hashCode()`
`protected String` | `name()`

Methods inherited from class org.apache.solr.search.function.distance.VectorDistanceFunction
`createWeight, description, getValues`

Methods inherited from class org.apache.solr.search.function.ValueSource
`getSortField, getValues, newContext, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### name

    protected String name

Constructor Detail

### SquaredEuclideanFunction

    public SquaredEuclideanFunction(MultiValueSource source1,
                                    MultiValueSource source2)

Method Detail

### 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 score
    `dv1` - The values from the first MultiValueSource
    `dv2` - 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD