Forums / Developer / Searching on attribute LIKE value

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

eZ debug

Timing: Jan 19 2025 07:09:49
Script start
Timing: Jan 19 2025 07:09:49
Module start 'content'
Timing: Jan 19 2025 07:09:51
Module end 'content'
Timing: Jan 19 2025 07:09:51
Script end

Main resources:

Total runtime1.8411 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 590.1094180.8281
Module start 'content' 0.00611.6660 770.9375545.2188
Module end 'content' 1.67200.1690 1,316.1563332.7422
Script end 1.8410  1,648.8984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.2127210.0002
Check MTime0.00140.0745210.0001
Mysql Total
Database connection0.00080.042410.0008
Mysqli_queries1.755795.36051940.0091
Looping result0.00240.12781920.0000
Template Total1.813398.520.9067
Template load0.00180.098720.0009
Template processing1.811598.390520.9058
Template load and register function0.00020.011710.0002
states
state_id_array0.00140.077910.0014
state_identifier_array0.00190.100720.0009
Override
Cache load0.00150.0804240.0001
Sytem overhead
Fetch class attribute can translate value0.00230.125130.0008
Fetch class attribute name0.00340.182850.0007
XML
Image XML parsing0.00510.274530.0017
class_abstraction
Instantiating content class attribute0.00000.000660.0000
General
dbfile0.01110.6035350.0003
String conversion0.00000.000330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs