public Builder(String field, GeoPoint point) { this(field, point == null ? null : point.geohash(), false); }
public Builder(String field, GeoPoint point) { this(field, point.geohash(), false); }
/** * Set a default location that should be used, if no location is * provided by the query * * @param point * location * @return this */ public Builder defaultLocation(GeoPoint point) { this.defaultLocations.add(point.geohash()); return this; }
/** * Set a default location that should be used, if no location is * provided by the query * * @param point * location * @return this */ public Builder defaultLocation(GeoPoint point) { this.defaultLocations.add(point.geohash()); return this; }
multiFields.parse(this, context.createExternalValueContext(point.geohash()));
geohashes.add(spare.geohash());
return new GeoQuery(name, point.geohash(), precision); } else { return new GeoQuery(name, GeoUtils.parseGeoPoint(parser).getGeohash(), precision);
geohashes.add(spare.geohash());
return new GeoQuery(name, point.geohash(), precision); } else { return new GeoQuery(name, GeoUtils.parseGeoPoint(parser).getGeohash(), precision);
@Override public void parse(ParseContext originalContext, GeoPoint point, String geoHash) throws IOException { // Geopoint fields, by default, will not be included in _all final ParseContext context = originalContext.setIncludeInAllDefault(false); if (ignoreMalformed.value() == false) { if (point.lat() > 90.0 || point.lat() < -90.0) { throw new IllegalArgumentException("illegal latitude value [" + point.lat() + "] for " + name()); } if (point.lon() > 180.0 || point.lon() < -180) { throw new IllegalArgumentException("illegal longitude value [" + point.lon() + "] for " + name()); } } else { GeoUtils.normalizePoint(point); } if (fieldType().indexOptions() != IndexOptions.NONE) { context.doc().add(new LatLonPoint(fieldType().name(), point.lat(), point.lon())); } if (fieldType().stored()) { context.doc().add(new StoredField(fieldType().name(), point.toString())); } if (fieldType.hasDocValues()) { context.doc().add(new LatLonDocValuesField(fieldType().name(), point.lat(), point.lon())); } // if the mapping contains multifields then use the geohash string if (multiFields.iterator().hasNext()) { multiFields.parse(this, context.createExternalValueContext(point.geohash())); } } }
multiFields.parse(this, context.createExternalValueContext(point.geohash()));
multiFields.parse(this, context.createExternalValueContext(point.geohash()));