[sword-svn] r246 - trunk/webapp
scribe at crosswire.org
scribe at crosswire.org
Tue Apr 25 00:48:07 MST 2006
Author: scribe
Date: 2006-04-25 00:48:05 -0700 (Tue, 25 Apr 2006)
New Revision: 246
Modified:
trunk/webapp/wordsearchresults.jsp
Log:
Tried to make some intuitive decisions when to re-sort by score
Modified: trunk/webapp/wordsearchresults.jsp
===================================================================
--- trunk/webapp/wordsearchresults.jsp 2006-04-22 06:48:15 UTC (rev 245)
+++ trunk/webapp/wordsearchresults.jsp 2006-04-25 07:48:05 UTC (rev 246)
@@ -81,6 +81,14 @@
if ((activeSearchTerm != null) && (activeSearchTerm.trim().length() > 0)) {
mgr.setGlobalOption("Greek Accents", "Off");
results = activeModule.search(activeSearchTerm, stype, soptions, range);
+ // let's make some intuitive decisions on when to sort by score
+ if ((results.length > 100) && (activeSearchTerm.indexOf(" ") > 0) && (activeSearchTerm.indexOf("+") < 1)) {
+ Arrays.sort(results, new Comparator() {
+ public int compare(Object o1, Object o2) {
+ return ((SearchHit)o2).score - ((SearchHit)o1).score;
+ }
+ });
+ }
mgr.setGlobalOption("Greek Accents", "On");
//save the search reusult into the session so it can be retrived later on to browse through it
More information about the sword-cvs
mailing list