james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1130603 - /james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/lucene/LuceneMessageSearchIndex.java
Date Thu, 02 Jun 2011 15:25:18 GMT
Author: norman
Date: Thu Jun  2 15:25:18 2011
New Revision: 1130603

URL: http://svn.apache.org/viewvc?rev=1130603&view=rev
Log:
Remove one not needed BooleanQuery. See MAILBOX-10

Modified:
    james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/lucene/LuceneMessageSearchIndex.java

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/lucene/LuceneMessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/lucene/LuceneMessageSearchIndex.java?rev=1130603&r1=1130602&r2=1130603&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/lucene/LuceneMessageSearchIndex.java
(original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/lucene/LuceneMessageSearchIndex.java
Thu Jun  2 15:25:18 2011
@@ -290,7 +290,13 @@ public class LuceneMessageSearchIndex<Id
             searcher = new IndexSearcher(IndexReader.open(writer, true));
             BooleanQuery query = new BooleanQuery();
             query.add(new TermQuery(new Term(MAILBOX_ID_FIELD, mailbox.getMailboxId().toString())),
BooleanClause.Occur.MUST);
-            query.add(createQuery(searchQuery, mailbox), BooleanClause.Occur.MUST);
+
+            List<Criterion> crits = searchQuery.getCriterias();
+            for (int i = 0; i < crits.size(); i++) {
+                query.add(createQuery(crits.get(i), mailbox), BooleanClause.Occur.MUST);
+            }
+            
+            //System.out.println(query.toString());
             
             // query for all the documents sorted by uid
             TopDocs docs = searcher.search(query, null, maxQueryResults, UID_SORT);
@@ -444,23 +450,6 @@ public class LuceneMessageSearchIndex<Id
 
         return doc;
     }
-    /**
-     * Create a {@link Query} based on the given {@link SearchQuery}
-     * 
-     * @param searchQuery
-     * @return query
-     * @throws UnsupportedSearchException
-     */
-    private Query createQuery(SearchQuery searchQuery, Mailbox<?> mailbox) throws UnsupportedSearchException,
MailboxException {
-        List<Criterion> crits = searchQuery.getCriterias();
-        BooleanQuery booleanQuery = new BooleanQuery();
-
-        for (int i = 0; i < crits.size(); i++) {
-            booleanQuery.add(createQuery(crits.get(i), mailbox), BooleanClause.Occur.MUST);
-        }
-        return booleanQuery;
-
-    }
 
 
     private String toInteralDateField(DateResolution res) {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message