Sorting not working - ignores parameters

Author Message

Ivan Švogor

Wednesday 12 January 2011 1:07:34 am

Hello!

I'm using object relations to sort out categories of published news. In my page I want to arrange them by published date. But this parameter si ignored. What coud be wrong here?(O yeah, I have installed ezfind)

{def $search=fetch( 'content', 'search',
                    hash( 'text', array('Homepage'),
                                'sort_by', array( 'published', true()),
                          'class_id', 63, 
                          'class_attribute_id', 471, 
                          'limit', $limit,
                          'offset', $offset ))}
        

        
        {def $meny_count=$search.SearchCount}
         
        {foreach $search.SearchResult as $matched_node}
            {node_view_gui content_node=$matched_node view='line'}
        {/foreach}

Ivan Švogor

Wednesday 12 January 2011 2:46:53 am

Yeah... ask question first, find out later :)

so here is the solution... Something is wrong with old search, so it is better to use ezfind's fetch function:

{def $search=fetch( 'ezfind', 'search',
                    hash( 'text', array('Homepage'),
                          'sort_by', hash(published, desc),
                          'class_id', 63, 
                          'class_attribute_id', 471, 
                          'limit', $limit,
                          'offset', $offset ))}

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 18 2025 11:42:18
Script start
Timing: Jan 18 2025 11:42:18
Module start 'layout'
Timing: Jan 18 2025 11:42:18
Module start 'content'
Timing: Jan 18 2025 11:42:20
Module end 'content'
Timing: Jan 18 2025 11:42:20
Script end

Main resources:

Total runtime1.2614 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0120 588.0391152.6406
Module start 'layout' 0.01200.0102 740.679739.4688
Module start 'content' 0.02211.2380 780.1484425.2188
Module end 'content' 1.26010.0012 1,205.36728.1406
Script end 1.2613  1,213.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2967160.0002
Check MTime0.00150.1155160.0001
Mysql Total
Database connection0.00220.173510.0022
Mysqli_queries1.203395.3985520.0231
Looping result0.00070.0528500.0000
Template Total1.193594.620.5968
Template load0.00270.210320.0013
Template processing1.190994.410120.5954
Template load and register function0.00030.023210.0003
states
state_id_array0.00160.129410.0016
state_identifier_array0.00190.154120.0010
Override
Cache load0.00210.1645100.0002
Sytem overhead
Fetch class attribute can translate value0.00070.057110.0007
Fetch class attribute name0.00140.114320.0007
XML
Image XML parsing0.00020.018810.0002
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00360.2829100.0004
String conversion0.00000.000940.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
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs