Forums / Install & configuration / Lucene: sort by score

Lucene: sort by score

Author Message

Børge Warvik

Wednesday 02 May 2007 5:58:08 am

Hi,

I've just had Lucene installed on my server, and I can't find out how to sort the result by the given score (percentage). Anyone now how to do this?

Thanks,
Børge Warvik

Peter Putzer

Wednesday 02 May 2007 7:27:14 am

I've written a (currently unpublished) extension for this purpose. It's a template operator that takes a Lucene result set and returns it sorted by score. It's not documented or anything, but if you like, I can publish it on /community/contrib.

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Børge Warvik

Wednesday 02 May 2007 8:05:46 am

Hi,

that would be nice. Please do.

Thanks,
Børge Warvik

Peter Putzer

Wednesday 02 May 2007 8:49:19 am

Done. The extension is available at http://ez.no/community/contribs/template_plugins/lucene_score_sorting

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Paul Borgermans

Wednesday 02 May 2007 10:55:46 am

Hi Børge

What's the problem here? Results are sorted by score by default.
Or is it with multiple sorting criteria?

Regards
Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Peter Putzer

Wednesday 02 May 2007 2:01:49 pm

It's not if you use <i>subtree_array</i> to include only certain parts of the site in the search.

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Paul Borgermans

Wednesday 02 May 2007 2:26:56 pm

OK, a very quick review of the code did not yield the culprit, no time to look closer now, but this is a bug.

I'll check later when I've more time.

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Børge Warvik

Thursday 03 May 2007 3:32:25 am

Hi Paul,

It's my mistake. I didn't know that no sorting attribute in the fetch statement would give this sorting... my bad :) Couldn't find anything about that reading the comments... but I've probably just missed it.

Børge

eZ debug

Timing: Jan 18 2025 10:35:25
Script start
Timing: Jan 18 2025 10:35:25
Module start 'content'
Timing: Jan 18 2025 10:35:26
Module end 'content'
Timing: Jan 18 2025 10:35:26
Script end

Main resources:

Total runtime1.0752 sec
Peak memory usage4,096.0000 KB
Database Queries211

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.7109180.8359
Module start 'content' 0.00810.9417 768.5469645.1172
Module end 'content' 0.94990.1252 1,413.6641341.0938
Script end 1.0751  1,754.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3788210.0002
Check MTime0.00150.1386210.0001
Mysql Total
Database connection0.00120.110710.0012
Mysqli_queries0.987991.87922110.0047
Looping result0.00220.20322090.0000
Template Total1.037496.520.5187
Template load0.00230.211820.0011
Template processing1.035196.270820.5176
Template load and register function0.00010.008410.0001
states
state_id_array0.00250.234210.0025
state_identifier_array0.00140.129020.0007
Override
Cache load0.00200.1822400.0000
Sytem overhead
Fetch class attribute can translate value0.00100.088640.0002
Fetch class attribute name0.00110.1060110.0001
XML
Image XML parsing0.00170.158640.0004
class_abstraction
Instantiating content class attribute0.00000.0025160.0000
General
dbfile0.00390.3600400.0001
String conversion0.00000.000830.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 34
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs