Steven E. Bailey
|
Tuesday 14 June 2011 2:00:54 am
According to the documentation http://doc.ez.no/Extensions/eZ-Publish-extensions/eZ-Find/eZ-Find-2.3/Customization/Template-fetch-functions, I can use multiple sort_by fields: <span class="line">fetch( ezfind, search, hash( query, 'eZ Systems', sort_by,</span>
<span class="line">hash( class_name, asc, published, desc ) ) )</span>
But if I use 'sort_by', hash( 'score', 'desc' ) - it works as expected, and 'sort_by', hash( 'published', 'desc' ) - also works as expected, But, 'sort_by', hash( 'score', 'desc', 'published', 'desc' ), Sorts by score for me but the published dates are seemingly random. Does this work for other people (version 2.3), am I doing something wrong, or is this a bug?
Certified eZPublish developer
http://ez.no/certification/verify/396111
Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com
|
Paul Borgermans
|
Monday 15 August 2011 5:27:43 am
Hi Steven As I commented in the issue tracker, this is actually not a bug: sorting is done by Solr, and trying to use anything else as a second scoring option will likely fail. The score is a float when Solr computes it, and the likelihood that two values in the result list will be identical is very small. But I have the feeling you want to do something else: boost more recent documents perhaps? hth Paul
eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans
|
Steven E. Bailey
|
Monday 15 August 2011 8:43:19 am
Yeah I figured as much as far as a bug goes - it really working as expected although it's always going to have the weird effect when sorting with score and something else. I don't think boosting will help - all that will do is change the score, right? It's really only that a customer noticed because they wanted a list of documents by score and then noticed the dates were random and asked if we could sort by date too. Maybe a caveat should be added to the documentation where it describes how to sort by multiple parameters. I suppose there's no way to trick solr into storing the score as a int when indexing? I just googled this and came up a bunch of people asking the same thing for solr going back until 2008 with no good asnwers. You may as well close the bug and call it a feature. Although it would be nice to document it somewhere other than here.
Certified eZPublish developer
http://ez.no/certification/verify/396111
Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com
|