org.apache.lucene.spatial.vector
Class DistanceValueSource

java.lang.Object
  extended by org.apache.lucene.queries.function.ValueSource
      extended by org.apache.lucene.spatial.vector.DistanceValueSource

public class DistanceValueSource
extends ValueSource

An implementation of the Lucene ValueSource model to support spatial relevance ranking.


Constructor Summary
DistanceValueSource(com.spatial4j.core.shape.Point from, com.spatial4j.core.distance.DistanceCalculator calc, TwoDoublesFieldInfo fields, FieldCache.DoubleParser parser)
          Constructor.
 
Method Summary
 String description()
          Returns the ValueSource description.
 boolean equals(Object o)
          Determines if this ValueSource is equal to another.
 FunctionValues getValues(Map context, AtomicReaderContext readerContext)
          Returns the FunctionValues used by the function query.
 int hashCode()
           
 
Methods inherited from class org.apache.lucene.queries.function.ValueSource
createWeight, getSortField, newContext, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistanceValueSource

public DistanceValueSource(com.spatial4j.core.shape.Point from,
                           com.spatial4j.core.distance.DistanceCalculator calc,
                           TwoDoublesFieldInfo fields,
                           FieldCache.DoubleParser parser)
Constructor.

Method Detail

description

public String description()
Returns the ValueSource description.

Specified by:
description in class ValueSource

getValues

public FunctionValues getValues(Map context,
                                AtomicReaderContext readerContext)
                         throws IOException
Returns the FunctionValues used by the function query.

Specified by:
getValues in class ValueSource
Throws:
IOException

equals

public boolean equals(Object o)
Determines if this ValueSource is equal to another.

Specified by:
equals in class ValueSource
Parameters:
o - the ValueSource to compare
Returns:
true if the two objects are based upon the same query envelope

hashCode

public int hashCode()
Specified by:
hashCode in class ValueSource


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