eZFind 2.3 + eZGmapLocation Datafield with empty values

Author Message

Ronan Guilloux

Tuesday 07 December 2010 8:44:49 am

Hey geoloc/ezfind fans,

I tried to index gmapLocation Datatype into Solr using eZFind 2.3, and it works well,

but it seems that empty values are not updated in the solr index.

I tried this : add a ezgmaplocation in a test class, setted up ezfind.ini for a correct ezgmaplocation mapping in solr, added geoloc content => my content is successfully founded it in the ezfind results.

But when I update my content object, emptying my geloc value in the ezgmaplocation field, it still appears in solr index : When I copy/past the ezfind query in the solr admin interface, I can still see my geoloc values in solr => solr index isn't updated when emptying geoloc values.

Did anyone encountered this issue too ?

I documented it here : http://issues.ez.no/IssueView.php?Id=17736

Keywords : geolocalization geolocalisation geolocation geoloc ezfind indexing ezgmaplocation ezfSolrDocumentFieldGmapLocation ezfSolrDocumentFieldGmapLocation.php

--
Ronan Guilloux

Edi Modrić

Wednesday 08 December 2010 2:20:09 am

It seems that the problem is in ezfSolrDocumentFieldGmapLocation::getData method.

Basicly, it doesn't check if the values are empty and does not assign a default value to the array returned to eZSolr class if they are. Instead, getData returns an array with empty values, which ezfind/solr obviously interprets as "no need to update the value".

This can be solved with the patch on the following link http://pastebin.com/YRvH7Gj9

Ofcourse, then you will need to change your template/php code to take into account attribute values with longitude and latitude set to 0 and interpret them as not having a location.

eZ Publish certified developer

http://ez.no/certification/verify/350658

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.