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

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 18 2025 11:41:37
Script start
Timing: Jan 18 2025 11:41:37
Module start 'layout'
Timing: Jan 18 2025 11:41:37
Module start 'content'
Timing: Jan 18 2025 11:41:38
Module end 'content'
Timing: Jan 18 2025 11:41:38
Script end

Main resources:

Total runtime0.7006 sec
Peak memory usage4,096.0000 KB
Database Queries74

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.0625152.6406
Module start 'layout' 0.00710.0054 740.703139.4766
Module start 'content' 0.01250.6865 780.1797688.3828
Module end 'content' 0.69900.0016 1,468.562516.1328
Script end 0.7006  1,484.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5101160.0002
Check MTime0.00150.2097160.0001
Mysql Total
Database connection0.00140.194510.0014
Mysqli_queries0.630489.9812740.0085
Looping result0.00080.1108720.0000
Template Total0.658494.020.3292
Template load0.00210.300820.0011
Template processing0.656293.666120.3281
Template load and register function0.00010.014710.0001
states
state_id_array0.00100.139510.0010
state_identifier_array0.00090.131620.0005
Override
Cache load0.00190.2650550.0000
Sytem overhead
Fetch class attribute can translate value0.00100.137450.0002
Fetch class attribute name0.00120.166390.0001
XML
Image XML parsing0.00180.258550.0004
class_abstraction
Instantiating content class attribute0.00000.0019100.0000
General
dbfile0.00120.1722270.0000
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs