Searching on attribute LIKE value

Author Message

Massimiliano Bariola

Tuesday 28 June 2005 6:42:37 am

hi,

is there a way to implement the LIKE functionality for attribute_filter?

e.g. from documentation, I would like to find all nodes whose Text attribute contains the word "the". So, I'd like to pass as condition not "=" but "%" for contains (a-la-mysql).

as far as I know, attribute_filter allows me only to search for the exact match, unless I write my own search extension.

As this is - I suppose - a VERY common need for eZ programmers, I am wondering whether there is a simpler/quicker way.

Paul Borgermans

Tuesday 28 June 2005 9:26:49 am

Hi

This was added in 3.6, see

http://pubsvn.ez.no/nextgen/stable/3.6/doc/features/3.6/content_tree_enhanced_filters.txt

I also created patches againts 3.5.2 and 3.4.6. Still have to do it for the 3.5.3 and 3.4.7 releases:

http://ez.no/community/contribs/hacks/more_attribute_filter_operators_and_fetch_by_owner_id

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Massimiliano Bariola

Tuesday 28 June 2005 10:49:48 am

Yay!!!!

exactly what I needed! thanks Paul for pointing it to me. I was browsing the 3.6 documentation but found no trace of it.

thanks again,

Max

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 19 2025 03:39:11
Script start
Timing: Jan 19 2025 03:39:11
Module start 'layout'
Timing: Jan 19 2025 03:39:11
Module start 'content'
Timing: Jan 19 2025 03:39:13
Module end 'content'
Timing: Jan 19 2025 03:39:13
Script end

Main resources:

Total runtime1.6318 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0094 590.2813152.6250
Module start 'layout' 0.00940.0030 742.906339.4609
Module start 'content' 0.01241.6181 782.3672540.1406
Module end 'content' 1.63050.0013 1,322.507812.1563
Script end 1.6318  1,334.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2041160.0002
Check MTime0.00140.0863160.0001
Mysql Total
Database connection0.00120.076110.0012
Mysqli_queries1.571996.3311570.0276
Looping result0.00060.0370550.0000
Template Total1.592097.620.7960
Template load0.00210.128720.0010
Template processing1.589997.433520.7950
Template load and register function0.00030.015410.0003
states
state_id_array0.00140.085410.0014
state_identifier_array0.00140.083020.0007
Override
Cache load0.00170.1067240.0001
Sytem overhead
Fetch class attribute can translate value0.00080.049420.0004
Fetch class attribute name0.00110.065350.0002
XML
Image XML parsing0.00130.078920.0006
class_abstraction
Instantiating content class attribute0.00000.000760.0000
General
dbfile0.00220.1337240.0001
String conversion0.00000.000440.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs