attribute_filter on xmltext and text fields?

Author Message

Gabriel Ambuehl

Friday 07 October 2005 5:17:15 am

Is there a way to do a fetch like

attribute_filter(textfield, like, "some keyword")

on text fields and xml text fields? Or do I need to write my own filter?

Thanks anyway!

Visit http://triligon.org

Paul Borgermans

Friday 07 October 2005 6:43:30 am

Yes,

My patch landed in the core since 3.6:

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

-paul

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

Hans Melis

Friday 07 October 2005 8:33:32 am

The 'like' operator indeed exists since 3.6, but the eztext and ezxmltext datatypes unfortunately don't support attribute filtering.

There wouldn't be a problem to implement it if the content of the datatypes contains less than 256 characters. In case there are more characters, some truncating is needed which is kind of pointless for those datatypes (the database field for string attribute filtering is a VARCHAR(255) in mysql and pgsql).

I think it's possible to implement what you want using extended attribute filtering. Just do an sql LIKE operation on the data_text field for the datatypes.

Hans
http://blog.hansmelis.be

Gabriel Ambuehl

Friday 07 October 2005 8:45:13 am

Yes, it works like a charm for text line but I was wondering about the two "long string" types, mostly.

I'll likely write an extended attribute filter some time (or maybe see if I can hack the core and submit it as patch), but for the time being, I'll likely be able to get away without it ;)

Visit http://triligon.org

Paul Borgermans

Friday 07 October 2005 11:20:12 am

For longer text fields, why not use the search as a fetch function? The like operator may slow things a lot in this case?

-paul

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

Gabriel Ambuehl

Friday 07 October 2005 11:55:14 am

I was thinking about that. And also just using a custom join on the search table. Haven't made up my mind yet ;)

Visit http://triligon.org

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 20 2025 17:41:23
Script start
Timing: Jan 20 2025 17:41:23
Module start 'layout'
Timing: Jan 20 2025 17:41:23
Module start 'content'
Timing: Jan 20 2025 17:41:23
Module end 'content'
Timing: Jan 20 2025 17:41:23
Script end

Main resources:

Total runtime0.0165 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.5703151.2266
Module start 'layout' 0.00610.0030 740.796936.6797
Module start 'content' 0.00900.0058 777.476694.0938
Module end 'content' 0.01480.0016 871.570337.9922
Script end 0.0165  909.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.9850140.0002
Check MTime0.00116.8057140.0001
Mysql Total
Database connection0.00095.710010.0009
Mysqli_queries0.002917.414330.0010
Looping result0.00000.091010.0000
Template Total0.00127.210.0012
Template load0.00095.522310.0009
Template processing0.00031.658810.0003
Override
Cache load0.00063.797010.0006
General
dbfile0.00127.045480.0001
String conversion0.00000.052040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs