Forums / Extensions / eZ Find / Mulitiple sort_by fields

Mulitiple sort_by fields

|
|
Next topic
 »
Author Message

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

Steven E. Bailey

Wednesday 10 August 2011 12:55:34 am

Anyone?

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Steven E. Bailey

Wednesday 10 August 2011 4:30:06 am

Added an issue:

http://issues.ez.no/IssueView.php?Id=18536&activeItem=1

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

eZ debug

Timing: Jan 17 2025 23:44:21
Script start
Timing: Jan 17 2025 23:44:21
Module start 'content'
Timing: Jan 17 2025 23:44:21
Module end 'content'
Timing: Jan 17 2025 23:44:21
Script end

Main resources:

Total runtime0.1362 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 591.9375180.7891
Module start 'content' 0.00610.0050 772.7266103.0859
Module end 'content' 0.01110.1250 875.8125532.3047
Script end 0.1362  1,408.1172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.6273200.0002
Check MTime0.00141.0141200.0001
Mysql Total
Database connection0.00060.445610.0006
Mysqli_queries0.096670.93771410.0007
Looping result0.00120.87601390.0000
Template Total0.124791.510.1247
Template load0.00090.693810.0009
Template processing0.123890.852610.1238
Override
Cache load0.00070.501410.0007
Sytem overhead
Fetch class attribute can translate value0.00050.352510.0005
XML
Image XML parsing0.00020.167510.0002
General
dbfile0.00161.1445200.0001
String conversion0.00000.005830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs