jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r823455 - /jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/search.jsp
Date Fri, 09 Oct 2009 08:43:12 GMT
Author: mreutegg
Date: Fri Oct  9 08:43:12 2009
New Revision: 823455

URL: http://svn.apache.org/viewvc?rev=823455&view=rev
Log:
JCR-2352: Search results not ordered

Modified:
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/search.jsp

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/search.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/search.jsp?rev=823455&r1=823454&r2=823455&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/search.jsp (original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/search.jsp Fri Oct  9 08:43:12 2009
@@ -69,12 +69,12 @@
             String stmt;
             if (q.startsWith("related:")) {
                 String path = q.substring("related:".length());
-                stmt = "//element(*, nt:file)[rep:similar(jcr:content, '" + path + "/jcr:content')]/rep:excerpt(.)";
+                stmt = "//element(*, nt:file)[rep:similar(jcr:content, '" + path + "/jcr:content')]/rep:excerpt(.)
order by @jcr:score descending";
                 queryTerms = "similar to <b>" + Text.encodeIllegalXMLCharacters(path)
+ "</b>";
             } else {
                 queryTerms = "for <b>" + Text.encodeIllegalXMLCharacters(q) + "</b>";
                 q = q.replaceAll("'", "''");
-                stmt = "//element(*, nt:file)[jcr:contains(jcr:content, '" + q + "')]/rep:excerpt(.)";
+                stmt = "//element(*, nt:file)[jcr:contains(jcr:content, '" + q + "')]/rep:excerpt(.)
order by @jcr:score descending";
             }
             Query query = jcrSession.getWorkspace().getQueryManager().createQuery(stmt, Query.XPATH);
             long time = System.currentTimeMillis();



Mime
View raw message