org.apache.solr.search.function.distance

## Class GeohashHaversineFunction

- java.lang.Object
- - org.apache.lucene.queries.function.ValueSource
  - - org.apache.solr.search.function.distance.GeohashHaversineFunction

-     public class GeohashHaversineFunction
      extends ValueSource

  Calculate the Haversine distance between two geo hash codes.

  Ex: ghhsin(ValueSource, ValueSource, radius)

  See Also:
    `for more details on the implementation`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeohashHaversineFunction(ValueSource geoHash1, ValueSource geoHash2, double radius)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `createWeight(Map context, IndexSearcher searcher)`
    `String` | `description()`
    `protected double` | `distance(int doc, FunctionValues gh1DV, FunctionValues gh2DV)`
    `boolean` | `equals(Object o)`
    `FunctionValues` | `getValues(Map context, LeafReaderContext readerContext)`
    `int` | `hashCode()`
    `protected String` | `name()`

    - ### Methods inherited from class org.apache.lucene.queries.function.ValueSource

      `getSortField, newContext, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### GeohashHaversineFunction

          public GeohashHaversineFunction(ValueSource geoHash1,
                                          ValueSource geoHash2,
                                          double radius)

  - ### Method Detail

    - #### name

          protected String name()

    - #### getValues

          public FunctionValues getValues(Map context,
                                          LeafReaderContext readerContext)
                                   throws IOException

      Specified by:
        `getValues` in class `ValueSource`
      Throws:
        `IOException`

    - #### distance

          protected double distance(int doc,
                                    FunctionValues gh1DV,
                                    FunctionValues gh2DV)

    - #### createWeight

          public void createWeight(Map context,
                                   IndexSearcher searcher)
                            throws IOException

      Overrides:
        `createWeight` in class `ValueSource`
      Throws:
        `IOException`

    - #### equals

          public boolean equals(Object o)

      Specified by:
        `equals` in class `ValueSource`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `ValueSource`

    - #### description

          public String description()

      Specified by:
        `description` in class `ValueSource`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.