1. 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?

Discussion in 'XenForo Development Discussions' started by Bugfix, May 31, 2014.

  1. Bugfix

    Bugfix Member

  2. Mike

    Mike XenForo Developer Staff Member

    Presumably you've added geo data to the index -- it's not there by default.
  3. Bugfix

    Bugfix Member

    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?
  4. Mike

    Mike 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.
    Marcus likes this.
  5. Bugfix

    Bugfix Member

    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...

Share This Page