Forums / Developer / Sorting not working - ignores parameters

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 ))}