Skip to content

Commit

Permalink
Update to Elasticsearch 6.1.3!
Browse files Browse the repository at this point in the history
  • Loading branch information
damienalexandre committed Feb 22, 2018
1 parent 0c9238a commit 28d93df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions esplugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
*/
Expand All @@ -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(
Expand Down

0 comments on commit 28d93df

Please sign in to comment.