content(ezfind, search) and extended attribute filter

Author Message

Sylvain Gogel

Wednesday 25 March 2009 2:16:04 am

Is it possible to mix the new ezfind, search fetch function with an existing extended attribute filter?

btw ezfind, search does not have the 'publish_date' parameter in his hash, which is bad.
I always struggle between using (ezfind, search) and (content, search)

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Sylvain Gogel

Thursday 26 March 2009 8:32:33 am

Reading EzFind 2.0 doc i found this

filter
The filter is used when creating faceted search templates for drill-down navigation. Filters
are used to limit the search result set without altering the relevancy sort order. Facet
results contain filter definitions that can be used directly. Custom filter definitions can also
be created.
A filter is specified by

<class_identifier>/<class_attribute>[/<sub_structure]:<value>. The
filter option may be a string or list of strings.

Unfortunaltly there is no exemple with sub_structure, can it allow to got throu an object relation?

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Sylvain Gogel

Tuesday 31 March 2009 5:03:20 am

No one knows how to filter by object relations then?

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Sylvain Gogel

Tuesday 31 March 2009 8:17:14 am

I finaly find out how to filter by a relation

{def $theme_node= fetch('content', 'node', hash('node_id', $search_theme_node_id))}

then add

'filter', concat('news/themes:',$theme_node.name)

Notice that themes is a object relation list attribute!!
Yata.

Now how can i filter on multiple classes at the same time:

'filter', array( 'or', 											concat('article/theme:',$theme_node.name),													concat('diaporama/theme:',$theme_node.name),
concat('news/theme:',$theme_node.name),
concat('folder/theme:',$theme_node.name),
concat('publication/theme:',$theme_node.name),
concat('quizz/theme:',$theme_node.name)
)

Does not look to work

(no filtering at all, it's like i'm not doing filter at all :( )
Should i mix that with class id?

--
http://www.ecedi.fr
Agence Web, Créa/Conseils, Accessibilité
eZPublish, Drupal, Zend, Symfony

Emmanuel Courmont

Wednesday 01 April 2009 6:47:24 pm

Hi Sylvain,

If you use an 'or' condition you may need to put your condition strings in an <b>array</b>.
Something similar to the example on page 16 of the ezfind2.0 documentation (http://ez.no/doc/extensions/ez_find)

try this:

'filter', array( 'or',
array( concat('article/theme:',$theme_node.name) ),
array( concat('diaporama/theme:',$theme_node.name) ),
array( concat('news/theme:',$theme_node.name) ),
array( concat('folder/theme:',$theme_node.name) ),
array( concat('publication/theme:',$theme_node.name) ),
array( concat('quizz/theme:',$theme_node.name) )
)

Hope it solves your pb.

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 04:52:54
Script start
Timing: Jan 18 2025 04:52:54
Module start 'layout'
Timing: Jan 18 2025 04:52:54
Module start 'content'
Timing: Jan 18 2025 04:52:55
Module end 'content'
Timing: Jan 18 2025 04:52:55
Script end

Main resources:

Total runtime0.7846 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.1875152.6563
Module start 'layout' 0.00450.0048 740.843839.5078
Module start 'content' 0.00930.7739 780.3516569.5938
Module end 'content' 0.78320.0014 1,349.945316.1016
Script end 0.7846  1,366.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4318160.0002
Check MTime0.00130.1717160.0001
Mysql Total
Database connection0.00060.079710.0006
Mysqli_queries0.724592.3403650.0111
Looping result0.00060.0774630.0000
Template Total0.744594.920.3722
Template load0.00230.296920.0012
Template processing0.742194.582120.3711
Template load and register function0.00010.018510.0001
states
state_id_array0.00150.189610.0015
state_identifier_array0.00150.184920.0007
Override
Cache load0.00210.2658420.0000
Sytem overhead
Fetch class attribute can translate value0.00190.240620.0009
Fetch class attribute name0.00160.208060.0003
XML
Image XML parsing0.00070.085520.0003
class_abstraction
Instantiating content class attribute0.00000.002690.0000
General
dbfile0.00090.1085160.0001
String conversion0.00000.001240.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs