jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r154824 - incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/SearchIndex.java
Date Tue, 22 Feb 2005 10:15:08 GMT
Author: mreutegg
Date: Tue Feb 22 02:15:06 2005
New Revision: 154824

URL: http://svn.apache.org/viewcvs?view=rev&rev=154824
Log:
QueryHandler does not release read lock when exception is thrown while creating executable
query.

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/SearchIndex.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/SearchIndex.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/SearchIndex.java?view=diff&r1=154823&r2=154824
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/SearchIndex.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/SearchIndex.java
Tue Feb 22 02:15:06 2005
@@ -235,27 +235,27 @@
             throw new IOException("Unable to obtain read lock on search index.");
         }
 
-        SortField[] sortFields = new SortField[orderProps.length];
-        for (int i = 0; i < orderProps.length; i++) {
-            String prop = null;
-            if (QueryConstants.JCR_SCORE.equals(orderProps[i])) {
-                // order on jcr:score does not use the natural order as
-                // implemented in lucene. score ascending in lucene means that
-                // higher scores are first. JCR specs that lower score values
-                // are first.
-                sortFields[i] = new SortField(null, SortField.SCORE, orderSpecs[i]);
-            } else {
-                try {
-                    prop = orderProps[i].toJCRName(nsMappings);
-                } catch (NoPrefixDeclaredException e) {
-                    // will never happen
+        Hits hits = null;
+        try {
+            SortField[] sortFields = new SortField[orderProps.length];
+            for (int i = 0; i < orderProps.length; i++) {
+                String prop = null;
+                if (QueryConstants.JCR_SCORE.equals(orderProps[i])) {
+                    // order on jcr:score does not use the natural order as
+                    // implemented in lucene. score ascending in lucene means that
+                    // higher scores are first. JCR specs that lower score values
+                    // are first.
+                    sortFields[i] = new SortField(null, SortField.SCORE, orderSpecs[i]);
+                } else {
+                    try {
+                        prop = orderProps[i].toJCRName(nsMappings);
+                    } catch (NoPrefixDeclaredException e) {
+                        // will never happen
+                    }
+                    sortFields[i] = new SortField(prop, SortField.STRING, !orderSpecs[i]);
                 }
-                sortFields[i] = new SortField(prop, SortField.STRING, !orderSpecs[i]);
             }
-        }
 
-        Hits hits = null;
-        try {
             if (sortFields.length > 0) {
                 hits = persistentIndex.getIndexSearcher().search(query,
                         new Sort(sortFields));



Mime
View raw message