mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 21:18:31 +00:00
Added missing support for lat, lats, lon, lons for doc notation in scripts
This commit is contained in:
parent
20e6df9f34
commit
eb21526552
@ -235,6 +235,33 @@ public abstract class ScriptDocValues {
|
||||
public GeoPoint getValue() {
|
||||
return values.getValue(docId);
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return getValue().lat();
|
||||
}
|
||||
|
||||
public double[] getLats() {
|
||||
List<GeoPoint> points = getValues();
|
||||
double[] lats = new double[points.size()];
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
lats[i] = points.get(i).lat();
|
||||
}
|
||||
return lats;
|
||||
}
|
||||
|
||||
public double [] getLons() {
|
||||
List<GeoPoint> points = getValues();
|
||||
double[] lons = new double[points.size()];
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
lons[i] = points.get(i).lon();
|
||||
}
|
||||
return lons;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return getValue().lon();
|
||||
}
|
||||
|
||||
|
||||
public List<GeoPoint> getValues() {
|
||||
if (!listLoaded) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user