From 28d93dff91337d5a6fb0ae97096b0276d8910209 Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Thu, 22 Feb 2018 21:57:40 +0100 Subject: [PATCH] Update to Elasticsearch 6.1.3! --- esplugin/build.gradle | 4 ++-- .../index/analysis/EmojiTokenizerFactory.java | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/esplugin/build.gradle b/esplugin/build.gradle index 0a25d68..17d9c9c 100644 --- a/esplugin/build.gradle +++ b/esplugin/build.gradle @@ -8,12 +8,12 @@ buildscript { jcenter() } dependencies { - classpath "org.elasticsearch.gradle:build-tools:6.1.2" + classpath "org.elasticsearch.gradle:build-tools:6.1.3" } } group = 'org.elasticsearch.plugin' -version = '6.1.2' +version = '6.1.3' apply plugin: 'java' apply plugin: 'elasticsearch.esplugin' diff --git a/esplugin/src/main/java/org/elasticsearch/index/analysis/EmojiTokenizerFactory.java b/esplugin/src/main/java/org/elasticsearch/index/analysis/EmojiTokenizerFactory.java index cfcbc64..4adb363 100644 --- a/esplugin/src/main/java/org/elasticsearch/index/analysis/EmojiTokenizerFactory.java +++ b/esplugin/src/main/java/org/elasticsearch/index/analysis/EmojiTokenizerFactory.java @@ -2,6 +2,7 @@ import com.ibm.icu.text.BreakIterator; import com.ibm.icu.text.RuleBasedBreakIterator; +import com.ibm.icu.util.ULocale; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.icu.segmentation.DefaultICUTokenizerConfig; import org.apache.lucene.analysis.icu.segmentation.ICUTokenizer; @@ -10,8 +11,6 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; -import java.util.Locale; - /** * Build an ICU Tokenizer using the latest ICU and a customized RuleSet for emoji status 200 */ @@ -26,13 +25,13 @@ public EmojiTokenizerFactory(IndexSettings indexSettings, Environment environmen public BreakIterator getBreakIterator(int script) { // Load the ICU default rules RuleBasedBreakIterator rbbi = (RuleBasedBreakIterator) - BreakIterator.getWordInstance(Locale.getDefault()); + BreakIterator.getWordInstance(ULocale.getDefault()); String defaultRules = rbbi.toString(); // Customize the rules to add EmojiNRK as first class word defaultRules = defaultRules.replace( "!!forward;", - "!!forward;\n$EmojiNRK {200};" + "!!forward;$EmojiNRK {200};" ); defaultRules = defaultRules.replace(