Geo Distance Filter with XenForo & ES?

sure! in /XenES/Model/Elasticsearch.php I changed the "$optimizedGenericMapping" array.
I tried:
1) "location" => array("type" => "geo_point")
2) "pin" => array("type" => "geo_point")

And the "_insertIntoIndex" Methode from my addon:
I tried:
1) 'location' => array('lat' => $data['latitude'], 'lon' => $data['longitude']),
2) 'pin' => array('location' => array('lat' => $data['latitude'], 'lon' => $data['longitude'])),

Nothing works for me. Where is my mistake?


XenForo developer
Staff member
If the data is in the ES index, probably best that you take XF out of it any just query directly.

Only suggestion I could make is that you're trying to query documents that don't have this field.
OMG - I found the mistake...
in the mapping, I used "type" => "uint" for another field... but correct would be "type" => "integer"...
because of this mistake, my mapping was not recognised...
and because of this, the geo-point was not recognised as geo but as string...