james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [07/21] james-project git commit: JAMES-2044 Adding SentDate support to Lucene message search index
Date Wed, 07 Jun 2017 10:46:17 GMT
JAMES-2044 Adding SentDate support to Lucene message search index


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/fc089b96
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/fc089b96
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/fc089b96

Branch: refs/heads/master
Commit: fc089b96b3ef81f2abded92b477cc30ab7b1c9e6
Parents: 7a7a0a6
Author: benwa <btellier@linagora.com>
Authored: Mon Jun 5 11:48:28 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Wed Jun 7 17:34:32 2017 +0700

----------------------------------------------------------------------
 .../org/apache/james/mailbox/model/SearchQuery.java   |  4 ++++
 .../lucene/search/LuceneMessageSearchIndex.java       |  3 +++
 .../lucene/search/LuceneMessageSearchIndexTest.java   | 14 --------------
 3 files changed, 7 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/fc089b96/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java b/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
index 5a28541..1ae0042 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
@@ -1269,6 +1269,10 @@ public class SearchQuery implements Serializable {
             return operator;
         }
 
+        public HeaderCriterion toHeaderCriterion() {
+            return new HeaderCriterion("Date", operator);
+        }
+
         @Override
         public int hashCode() {
             return Objects.hashCode(operator);

http://git-wip-us.apache.org/repos/asf/james-project/blob/fc089b96/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
index 91b39a6..8326cf1 100644
--- a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
+++ b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
@@ -1267,6 +1267,9 @@ public class LuceneMessageSearchIndex extends ListeningMessageSearchIndex
{
             return createConjunctionQuery(crit, inMailboxes, recentUids);
         } else if (criterion instanceof SearchQuery.ModSeqCriterion) {
             return createModSeqQuery((SearchQuery.ModSeqCriterion) criterion);
+        } else if (criterion instanceof SearchQuery.SentDateCriterion) {
+            SearchQuery.SentDateCriterion sentDateCriterion = (SearchQuery.SentDateCriterion)
criterion;
+            return createHeaderQuery(sentDateCriterion.toHeaderCriterion());
         }
         throw new UnsupportedSearchException();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/fc089b96/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java
----------------------------------------------------------------------
diff --git a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java
b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java
index 8e05fca..dc03f7f 100644
--- a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java
+++ b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java
@@ -150,18 +150,4 @@ public class LuceneMessageSearchIndexTest extends AbstractMessageSearchIndexTest
     public void multimailboxSearchShouldReturnUidOfMessageMarkedAsSeenInAllMailboxes() throws
MailboxException {
     }
 
-    @Ignore
-    @Override
-    public void sentDateAfterShouldReturnMessagesAfterAGivenDate() throws Exception {
-    }
-
-    @Ignore
-    @Override
-    public void sentDateBeforeShouldReturnMessagesBeforeAGivenDate() throws Exception {
-    }
-
-    @Ignore
-    @Override
-    public void sentDateOnShouldReturnMessagesOfTheGivenDate() throws Exception {
-    }
 }


---------------------------------------------------------------------
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