Sort search result

Author Message

Guyvarch Sebastien

Tuesday 19 July 2005 1:47:44 am

Hi all,

I would like to sort my search result according to the name of one attribute..
Is it possible and how can I do that?

Thx

Ɓukasz Serwatka

Friday 22 July 2005 1:14:50 am

Hi,

Attribute sorting can only be used if the returned collection contains the same type of nodes.

{def $search=fetch( 'content', 'search',
                    hash( 'text',     'example',
                          'class_id',  2,
                          'sort_by', array( 'my_class/my_attribute', false() ) ) )}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 06:26:22
Script start
Timing: Jan 19 2025 06:26:22
Module start 'layout'
Timing: Jan 19 2025 06:26:22
Module start 'content'
Timing: Jan 19 2025 06:26:23
Module end 'content'
Timing: Jan 19 2025 06:26:23
Script end

Main resources:

Total runtime0.8061 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.1328152.6094
Module start 'layout' 0.00590.0031 741.742239.4141
Module start 'content' 0.00900.7955 781.1563525.0078
Module end 'content' 0.80450.0016 1,306.16418.1875
Script end 0.8061  1,314.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4191160.0002
Check MTime0.00140.1739160.0001
Mysql Total
Database connection0.00130.160710.0013
Mysqli_queries0.762894.6356540.0141
Looping result0.00050.0614520.0000
Template Total0.776196.320.3880
Template load0.00230.281920.0011
Template processing0.773895.991920.3869
Template load and register function0.00020.026210.0002
states
state_id_array0.00090.116510.0009
state_identifier_array0.00070.088620.0004
Override
Cache load0.00180.2263120.0002
Sytem overhead
Fetch class attribute can translate value0.00080.103620.0004
Fetch class attribute name0.00160.194530.0005
XML
Image XML parsing0.00080.104220.0004
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00120.1471180.0001
String conversion0.00000.000640.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
2content/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
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 10
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs