public class HaversineConstFunction extends ValueSource
| Modifier and Type | Field and Description |
|---|---|
private static double |
EARTH_MEAN_DIAMETER |
private double |
latCenter |
private double |
latCenterRad_cos |
private ValueSource |
latSource |
private double |
lonCenter |
private ValueSource |
lonSource |
private VectorValueSource |
p2 |
static ValueSourceParser |
parser |
| Constructor and Description |
|---|
HaversineConstFunction(double latCenter,
double lonCenter,
VectorValueSource vs) |
| Modifier and Type | Method and Description |
|---|---|
void |
createWeight(java.util.Map context,
org.apache.lucene.search.Searcher searcher)
Implementations should propagate createWeight to sub-ValueSources which can optionally store
weight info in the context.
|
java.lang.String |
description()
description of field, used in explain()
|
boolean |
equals(java.lang.Object o) |
private static double[] |
getConstants(MultiValueSource vs) |
DocValues |
getValues(java.util.Map context,
org.apache.lucene.index.IndexReader reader)
Gets the values for this reader and the context that was previously
passed to createWeight()
|
int |
hashCode() |
private static VectorValueSource |
makeMV(java.util.List<ValueSource> sources,
java.util.List<ValueSource> orig)
make a MultiValueSource from two non MultiValueSources
|
protected java.lang.String |
name() |
private static MultiValueSource |
parsePoint(FunctionQParser fp) |
private static MultiValueSource |
parseSfield(FunctionQParser fp) |
getSortField, getValues, newContext, toStringpublic static ValueSourceParser parser
private final double latCenter
private final double lonCenter
private final VectorValueSource p2
private final ValueSource latSource
private final ValueSource lonSource
private final double latCenterRad_cos
private static final double EARTH_MEAN_DIAMETER
public HaversineConstFunction(double latCenter,
double lonCenter,
VectorValueSource vs)
private static VectorValueSource makeMV(java.util.List<ValueSource> sources, java.util.List<ValueSource> orig) throws org.apache.lucene.queryParser.ParseException
org.apache.lucene.queryParser.ParseExceptionprivate static MultiValueSource parsePoint(FunctionQParser fp) throws org.apache.lucene.queryParser.ParseException
org.apache.lucene.queryParser.ParseExceptionprivate static double[] getConstants(MultiValueSource vs)
private static MultiValueSource parseSfield(FunctionQParser fp) throws org.apache.lucene.queryParser.ParseException
org.apache.lucene.queryParser.ParseExceptionprotected java.lang.String name()
public DocValues getValues(java.util.Map context, org.apache.lucene.index.IndexReader reader) throws java.io.IOException
ValueSourcegetValues in class ValueSourcejava.io.IOExceptionpublic void createWeight(java.util.Map context,
org.apache.lucene.search.Searcher searcher)
throws java.io.IOException
ValueSourcecreateWeight in class ValueSourcejava.io.IOExceptionpublic boolean equals(java.lang.Object o)
equals in class ValueSourcepublic int hashCode()
hashCode in class ValueSourcepublic java.lang.String description()
ValueSourcedescription in class ValueSource