From 60eb78579d87c98b423977d11ab378cf693b51ed Mon Sep 17 00:00:00 2001 From: longkyanh Date: Thu, 22 Aug 2019 15:20:14 +0700 Subject: [PATCH 1/2] Support es v6.5.3 --- pom.xml | 4 ++-- .../index/analysis/VietnameseTokenizerFactory.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f191389..e972092 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.elasticsearch elasticsearch-analysis-vietnamese - 7.0.0 + 6.5.3 jar elasticsearch-analysis-vietnamese https://github.com/duydo/elasticsearch-analysis-vietnamese/ @@ -31,7 +31,7 @@ UTF-8 1.8 - 7.0.0 + 6.5.3 2.7 diff --git a/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java b/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java index 7dab7e0..5d9cb86 100644 --- a/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java +++ b/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java @@ -30,7 +30,7 @@ public class VietnameseTokenizerFactory extends AbstractTokenizerFactory { private final me.duydo.vi.Tokenizer tokenizer; public VietnameseTokenizerFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) { - super(indexSettings, settings); + super(indexSettings, name, settings); tokenizer = AccessController.doPrivileged((PrivilegedAction) () -> new me.duydo.vi.Tokenizer()); } From fcb1c067716a6937525e5100e3bf5c206d681239 Mon Sep 17 00:00:00 2001 From: longkyanh Date: Thu, 22 Aug 2019 22:47:30 +0700 Subject: [PATCH 2/2] Support ES v700 --- pom.xml | 4 ++-- .../index/analysis/VietnameseTokenizerFactory.java | 2 +- .../index/analysis/VietnameseAnalysisIntegrationTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e972092..f191389 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.elasticsearch elasticsearch-analysis-vietnamese - 6.5.3 + 7.0.0 jar elasticsearch-analysis-vietnamese https://github.com/duydo/elasticsearch-analysis-vietnamese/ @@ -31,7 +31,7 @@ UTF-8 1.8 - 6.5.3 + 7.0.0 2.7 diff --git a/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java b/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java index 5d9cb86..7dab7e0 100644 --- a/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java +++ b/src/main/java/org/elasticsearch/index/analysis/VietnameseTokenizerFactory.java @@ -30,7 +30,7 @@ public class VietnameseTokenizerFactory extends AbstractTokenizerFactory { private final me.duydo.vi.Tokenizer tokenizer; public VietnameseTokenizerFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) { - super(indexSettings, name, settings); + super(indexSettings, settings); tokenizer = AccessController.doPrivileged((PrivilegedAction) () -> new me.duydo.vi.Tokenizer()); } diff --git a/src/test/java/org/elasticsearch/index/analysis/VietnameseAnalysisIntegrationTest.java b/src/test/java/org/elasticsearch/index/analysis/VietnameseAnalysisIntegrationTest.java index 134df7e..313919e 100644 --- a/src/test/java/org/elasticsearch/index/analysis/VietnameseAnalysisIntegrationTest.java +++ b/src/test/java/org/elasticsearch/index/analysis/VietnameseAnalysisIntegrationTest.java @@ -75,6 +75,6 @@ public void testVietnameseAnalyzerInMapping() throws ExecutionException, Interru refresh(); SearchResponse response = client().prepareSearch("test").setQuery( QueryBuilders.matchQuery("foo", "công nghệ thông tin")).execute().actionGet(); - assertThat(response.getHits().getTotalHits(), is(1L)); + assertThat(response.getHits().getTotalHits().toString(), is("1 hits")); } }