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.

eZ debug

Timing: Jan 30 2025 00:56:10
Script start
Timing: Jan 30 2025 00:56:10
Module start 'layout'
Timing: Jan 30 2025 00:56:10
Module start 'content'
Timing: Jan 30 2025 00:56:10
Module end 'content'
Timing: Jan 30 2025 00:56:10
Script end

Main resources:

Total runtime0.0126 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.4063151.2422
Module start 'layout' 0.00450.0022 739.648436.7188
Module start 'content' 0.00680.0046 776.367291.3125
Module end 'content' 0.01140.0012 867.679733.9766
Script end 0.0126  901.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002217.4090140.0002
Check MTime0.00107.8435140.0001
Mysql Total
Database connection0.00064.799810.0006
Mysqli_queries0.002419.031030.0008
Looping result0.00000.086910.0000
Template Total0.00107.810.0010
Template load0.00086.280110.0008
Template processing0.00021.520010.0002
Override
Cache load0.00064.712910.0006
General
dbfile0.00108.123080.0001
String conversion0.00000.047240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs