I have a little problem with geo_point filter in my mapping.
mapping:
offer: ...
mapping: ...
location:
type: nested
include_in_parent: true
properties:
city:
type: string
analyzer: my_analyzer
boost: 0.5
include_in_all: true
region:
type: string
analyzer: my_analyzer
boost: 0.3
include_in_all: false
geo:
type: geo_point
lat_lon: true
boost: 0
include_in_all: false
When execute this code:
$filter = new Filter\BoolOr();
$geo = new Filter\Nested();
$geo->setPath('offer.location');
$geo->setFilter(
new Filter\GeoDistance('location.geo', array(
'lat' => $city->getLatitude(),
'lon' => $city->getLongitude()
), sprintf('%dkm', $distance))
);
$filter->addFilter($geo);
I get this exeption:
nested: QueryParsingException[[index] failed to find geo_point field [location.geo]];