Forums / Extensions / eZ Find / Is $search_date available for ezfind?

Is $search_date available for ezfind?

Author Message

laurent le cadet

Thursday 03 January 2008 5:03:55 am

Hi,

$search_date var doesn't seems to talk to ezfind.

I'm using ezfind 1.0.2 + ezPublish 3.9.4.

Reagrds.

Laurent

Kåre Køhler Høvik

Monday 14 January 2008 6:23:13 am

Hi

$search_date is not available. This might be something we forgot to include from the regular search in eZ Publish. Can you point me to existing documentation, or more information about it ?

Kåre

Kåre Høvik

Fredrik Ardmar

Saturday 19 January 2008 9:06:47 pm

Any news regarding this? Thinking of implementing it myself but if its included in future version that might be a more attractive option:)

http://www.areadigital.org

Custom google maps with eZ Publish

http://www.meresverige.dk
http://dsbfirst.meresverige.dk

Kåre Køhler Høvik

Monday 21 January 2008 12:35:29 am

Hi

$search_date will not be supported directly in eZ Find 1.1. However, it's possible to implement the same functionality using filters in eZ Find 1.1. I'll add how to emulate the search_date parameter with filers in the documentation for eZ Find 1.1

Btw, if there's functionality you'd like to see in future versions of eZ Find, please use the issue tracker: http://issues.ez.no/ProjectSelect.php?Id=8

Best regards
Kåre

Kåre Høvik

Josh Apostolides

Sunday 22 June 2008 12:27:55 pm

$search_date would be nice to have in my situation. I have turned the advanced search into a "document library" search function where eZ Find indexes the contents of several thousand pdf and doc files. Is it possible to implement your search filter technique in a eZ Publish 4 + eZ Find 1.0.0beta2 installation?

Gilles Ballini

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 */