Customized AND search on several class attributes in one search

Author Message

Tore Skobba

Wednesday 11 February 2004 9:25:28 am

Hi

I want to use the new search fetch to make an customized search

ref: http://www.ez.no/ez_publish/documentation/customization/components/search/search_operator
http://www.ez.no/ez_publish/documentation/customization/components/search/templates

More specific I want to search among my registred user (in an customized user class), an example form is this:

Name: Textfield used to enter an name to search for (Searchtext)
Class of: An selection of {1999,2000,2001} used to mark which Class_of to search for, user class have an EZSelection, identifier: class_of.

For example: search for Name="Tore Skobba" having Class of="2000" (class of must then be remapped to the ezselection values {0,1,2}. The remapping is no problem, same thing with searching for each element seperately. But how should I approach the problem of searching on several different class attributes in one search? Is it possible without making an extension?

For example this fetch:
{let search=fetch(content,search,hash(text,'Skobba',class_id,'33',class_attribute_id,array('216','220')))}

Seem to search in my User class(33) with OR, i.e. last name(214)=Skobba OR class_of(216)=Skobba, alternatively if I am using class_of selection as my searchtext: last name=0 OR class_of=0. I want an AND there:).

Any tips?

Hmm maybee I could use an fetch(content, tree with parent node equal my user root folder, then add all my parameters?

Cheers
Tore

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 10:00:12
Script start
Timing: Jan 19 2025 10:00:12
Module start 'layout'
Timing: Jan 19 2025 10:00:12
Module start 'content'
Timing: Jan 19 2025 10:00:12
Module end 'content'
Timing: Jan 19 2025 10:00:12
Script end

Main resources:

Total runtime0.5928 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.4141152.6563
Module start 'layout' 0.00550.0029 742.070339.5234
Module start 'content' 0.00840.5828 781.5938410.0625
Module end 'content' 0.59120.0016 1,191.65638.0938
Script end 0.5928  1,199.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5839160.0002
Check MTime0.00140.2335160.0001
Mysql Total
Database connection0.00100.161010.0010
Mysqli_queries0.552793.2431460.0120
Looping result0.00050.0767440.0000
Template Total0.566895.620.2834
Template load0.00190.317320.0009
Template processing0.564995.301320.2825
Template load and register function0.00010.024310.0001
states
state_id_array0.00090.153810.0009
state_identifier_array0.00080.133020.0004
Override
Cache load0.00150.2552180.0001
Sytem overhead
Fetch class attribute can translate value0.00060.106310.0006
Fetch class attribute name0.00070.124410.0007
XML
Image XML parsing0.00010.018710.0001
class_abstraction
Instantiating content class attribute0.00000.001210.0000
General
dbfile0.00060.1068100.0001
String conversion0.00000.001440.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/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: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs