eZ Community » Forums » Extensions » eZ Find » sort multiple classes by attribute in...
expandshrink

sort multiple classes by attribute in eZ Find.

sort multiple classes by attribute in eZ Find.

Thursday 20 August 2009 12:56:40 pm - 1 reply

Is it possible to sort multiple classes by the attribute with the same name in eZ Find?

For example... I have two classes "News" and "Readers" which both have a "date" attribute. And I want results from ezfind fetch to be sorted by the "date" attribute. Is it possible?

Thursday 29 August 2013 3:00:36 pm

Just took 4 years to get an answer on this and I'm guessing it was answered somewhere else already.

I ran into the same questions. Here's what I found out:

I'm running ezfind 2.5.0 and it looks like it's possible. You need to use the attribute identifier of the solr index. In my case the attribute identifier in ezp is "publish_date" (datetime)  and I have it on multiple classes. The solr index maps this attribute to "attr_publish_date_dt". So you need to specify the sort parameter as:

'sort_by', hash( 'attr_publish_date_dt', 'desc' )

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from