[sword-svn] r248 - in trunk/webapp: . layouts

scribe at crosswire.org scribe at crosswire.org
Tue Apr 25 02:35:58 MST 2006


Author: scribe
Date: 2006-04-25 02:35:57 -0700 (Tue, 25 Apr 2006)
New Revision: 248

Modified:
   trunk/webapp/layouts/base-layout.jsp
   trunk/webapp/wordsearchresults.jsp
Log:
Widened search box a little
more intuitive when not to sort by score


Modified: trunk/webapp/layouts/base-layout.jsp
===================================================================
--- trunk/webapp/layouts/base-layout.jsp	2006-04-25 09:30:58 UTC (rev 247)
+++ trunk/webapp/layouts/base-layout.jsp	2006-04-25 09:35:57 UTC (rev 248)
@@ -48,13 +48,13 @@
         <h2><t:t>Search:</t:t></h2>
         <form action="wordsearchresults.jsp">
           <fieldset>
-            <legend><t:t>by keyword or phrase:</t:t></legend> <input type="text" name="searchTerm" value="<%=searchTerm%>" size="10" /> <input type="submit" value="go" title="Search by keyword or phrase" />
+            <legend><t:t>by keyword or phrase:</t:t></legend> <input type="text" name="searchTerm" value="<%=org.crosswire.utils.HTTPUtils.canonize(searchTerm)%>" size="15" /> <input type="submit" value="go" title="Search by keyword or phrase" />
           </fieldset>
         </form>
         <h2><t:t>Go to:</t:t></h2>
 	<form action="<tiles:getAsString name="lookup_url"/>">
           <fieldset>
-            <legend><t:t>verse or passage:</t:t></legend> <input type="text" name="key" size="10" /> <input type="submit" value="go" title="Go to verse or passage" />
+            <legend><t:t>verse or passage:</t:t></legend> <input type="text" name="key" size="15" /> <input type="submit" value="go" title="Go to verse or passage" />
           </fieldset>
         </form>
       </div>

Modified: trunk/webapp/wordsearchresults.jsp
===================================================================
--- trunk/webapp/wordsearchresults.jsp	2006-04-25 09:30:58 UTC (rev 247)
+++ trunk/webapp/wordsearchresults.jsp	2006-04-25 09:35:57 UTC (rev 248)
@@ -75,14 +75,18 @@
 
 	<tiles:put name="content" type="string">
 	<div id="searchresults">
-		<h2><t:t>Results for "</t:t><em><%= new String(activeSearchTerm.getBytes("iso8859-1"), "UTF-8") %></em>"</h2>
+		<h2><t:t>Results for</t:t> <em><%= new String(activeSearchTerm.getBytes("iso8859-1"), "UTF-8") %></em></h2>
 		<%
 			SearchHit[] results = null;
 			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)) {
+				if ((results.length > 100) && (activeSearchTerm.indexOf(" ") > 0)
+						 && (activeSearchTerm.indexOf("+") < 1)
+						 && (activeSearchTerm.indexOf("\"") < 1)
+						 && (activeSearchTerm.indexOf("~") < 1)
+						) {
 					Arrays.sort(results, new Comparator() {
 						public int compare(Object o1, Object o2) {
 							return ((SearchHit)o2).score - ((SearchHit)o1).score;



More information about the sword-cvs mailing list