You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2017/06/28 08:48:32 UTC
[3/3] james-project git commit: MAILBOX-301 Fix ElasticSearch long
term integration tests
MAILBOX-301 Fix ElasticSearch long term integration tests
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/55038dc0
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/55038dc0
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/55038dc0
Branch: refs/heads/master
Commit: 55038dc0c64091da5aa7bee27e871a92974f4900
Parents: 829adc7
Author: benwa <bt...@linagora.com>
Authored: Tue Jun 27 13:08:00 2017 +0700
Committer: benwa <bt...@linagora.com>
Committed: Wed Jun 28 15:47:14 2017 +0700
----------------------------------------------------------------------
.../org/apache/james/backends/es/NodeMappingFactory.java | 1 -
.../james/mailbox/elasticsearch/MailboxMappingFactory.java | 9 +++++----
.../mailbox/elasticsearch/ElasticSearchIntegrationTest.java | 2 --
3 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/55038dc0/backends-common/elasticsearch/src/main/java/org/apache/james/backends/es/NodeMappingFactory.java
----------------------------------------------------------------------
diff --git a/backends-common/elasticsearch/src/main/java/org/apache/james/backends/es/NodeMappingFactory.java b/backends-common/elasticsearch/src/main/java/org/apache/james/backends/es/NodeMappingFactory.java
index f60bcd2..3d16dc4 100644
--- a/backends-common/elasticsearch/src/main/java/org/apache/james/backends/es/NodeMappingFactory.java
+++ b/backends-common/elasticsearch/src/main/java/org/apache/james/backends/es/NodeMappingFactory.java
@@ -39,7 +39,6 @@ public class NodeMappingFactory {
public static final String ANALYZER = "analyzer";
public static final String SNOWBALL = "snowball";
public static final String IGNORE_ABOVE = "ignore_above";
- public static final int LUCENE_LIMIT = 32766;
public static Client applyMapping(Client client, IndexName indexName, TypeName typeName, XContentBuilder mappingsSources) {
client.admin()
http://git-wip-us.apache.org/repos/asf/james-project/blob/55038dc0/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/MailboxMappingFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/MailboxMappingFactory.java b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/MailboxMappingFactory.java
index a8456da..e87f575 100644
--- a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/MailboxMappingFactory.java
+++ b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/MailboxMappingFactory.java
@@ -27,7 +27,6 @@ import static org.apache.james.backends.es.NodeMappingFactory.FORMAT;
import static org.apache.james.backends.es.NodeMappingFactory.IGNORE_ABOVE;
import static org.apache.james.backends.es.NodeMappingFactory.INDEX;
import static org.apache.james.backends.es.NodeMappingFactory.LONG;
-import static org.apache.james.backends.es.NodeMappingFactory.LUCENE_LIMIT;
import static org.apache.james.backends.es.NodeMappingFactory.NESTED;
import static org.apache.james.backends.es.NodeMappingFactory.NOT_ANALYZED;
import static org.apache.james.backends.es.NodeMappingFactory.PROPERTIES;
@@ -76,6 +75,8 @@ import com.google.common.base.Throwables;
public class MailboxMappingFactory {
+ private static final int MAXIMUM_TERM_LENGTH = 4096;
+
public static XContentBuilder getMappingContent() {
try {
return jsonBuilder()
@@ -257,7 +258,7 @@ public class MailboxMappingFactory {
.startObject(RAW)
.field(TYPE, STRING)
.field(ANALYZER, CASE_INSENSITIVE)
- .field(IGNORE_ABOVE, LUCENE_LIMIT)
+ .field(IGNORE_ABOVE, MAXIMUM_TERM_LENGTH)
.endObject()
.endObject()
.endObject()
@@ -268,7 +269,7 @@ public class MailboxMappingFactory {
.startObject(RAW)
.field(TYPE, STRING)
.field(ANALYZER, CASE_INSENSITIVE)
- .field(IGNORE_ABOVE, LUCENE_LIMIT)
+ .field(IGNORE_ABOVE, MAXIMUM_TERM_LENGTH)
.endObject()
.endObject()
.endObject()
@@ -280,7 +281,7 @@ public class MailboxMappingFactory {
.startObject(TEXT)
.field(TYPE, STRING)
.field(ANALYZER, SNOWBALL)
- .field(IGNORE_ABOVE, LUCENE_LIMIT)
+ .field(IGNORE_ABOVE, MAXIMUM_TERM_LENGTH)
.endObject()
.endObject()
.endObject()
http://git-wip-us.apache.org/repos/asf/james-project/blob/55038dc0/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
index e690f95..a9344b2 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
@@ -60,7 +60,6 @@ import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
import org.apache.james.mailbox.store.mail.model.impl.MessageParser;
import org.apache.james.mailbox.store.search.AbstractMessageSearchIndexTest;
import org.elasticsearch.client.Client;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
@@ -123,7 +122,6 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest
storeMailboxManager.init();
}
- @Ignore("MAILBOX-301 Lucene terms length exceeded on some emails")
@Test
public void termsBetweenElasticSearchAndLuceneLimitDueTuNonAsciiCharsShouldBeTruncated() throws Exception {
MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, USERNAME, INBOX);
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org