• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Geo Distance Filter with XenForo & ES?

#3
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?
 

Mike

XenForo developer
Staff member
#4
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.
 
#5
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...
:ROFLMAO: