Tuesday 15 June 2010 5:20:10 am
eZ Find settings ( ezfind.ini, to be overridden in the ezfind.ini.append.php file of your extension ) allow for delegating the indexing process of an eZ Publish datatype to a given PHP class :
[SolrFieldMapSettings] CustomMap[ezdate]=ezfSolrDocumentFieldDate
Our PHP class, randomly named , ezfSolrDocumentFieldDate inherits from the ezfSolrDocumentFieldBase class, must be added to the /extension/myextension/classes folder and must inherit the following skeleton :
<?php class ezfSolrDocumentFieldDate extends ezfSolrDocumentFieldBase { public static function getFieldName( eZContentClassAttribute $classAttribute, $subAttribute = null, $context = 'search' ) { // return the fieldname like : attr_mydate_d } public function getData() { // return the array keys (fieldname => value), like : array('attr_mydate_dt' => '2010-04-30T00:00:00Z') } } ?>