Thursday 07 August 2008 7:30:06 am
Hi, for those who are interested, I made a patch of ezfind_1.0.0beta2 (for eZ v.4) to make this functionnality available. Here is the patch (file extension/ezfind/search/plugins/ezsolr/ezsolr.php) :
481a482,505
+
+ /* BEGIN PATCH : make $search_date available */
+ if (isset($params['SearchDate']) && $params['SearchDate'] > 0 ) {
+ $searchDateTime = new DateTime('today');
+ switch ($params['SearchDate']) {
+ case 1: // one day
+ $searchDateTime->modify("-1 day");
+ break;
+ case 2: // one week
+ $searchDateTime->modify("-1 week");
+ break;
+ case 3: // one month
+ $searchDateTime->modify("-1 month");
+ break;
+ case 4: // 3 months
+ $searchDateTime->modify("-3 months");
+ break;
+ case 5: // one year
+ $searchDateTime->modify("-1 year");
+ break;
+ }
+ $filterQuery[] = 'm_published:['.$searchDateTime->format('U').' TO *]';
+ } + /* END PATCH */
|