Skip to content
Permalink
Browse files
OAK-9772 Elastic and Lucene tokenizer difference (rename)
  • Loading branch information
thomasmueller committed May 18, 2022
1 parent 1427853 commit 9f085183c09a37ddf34718b2c93b8ff371a9ba13
Showing 1 changed file with 3 additions and 3 deletions.
@@ -32,7 +32,7 @@ public class OakAnalyzer extends Analyzer {

private final Version matchVersion;

private final int INDEX_ORIGINAL_TERM;
private final int preserveOriginal;

/**
* Creates a new {@link OakAnalyzer}
@@ -55,7 +55,7 @@ public OakAnalyzer(Version matchVersion) {
*/
public OakAnalyzer(Version matchVersion, boolean indexOriginalTerm) {
this.matchVersion = matchVersion;
INDEX_ORIGINAL_TERM = indexOriginalTerm?WordDelimiterFilter.PRESERVE_ORIGINAL:0;
preserveOriginal = indexOriginalTerm ? WordDelimiterFilter.PRESERVE_ORIGINAL : 0;
}

@Override
@@ -66,7 +66,7 @@ protected TokenStreamComponents createComponents(final String fieldName,
tok = new WordDelimiterFilter(tok,
WordDelimiterFilter.GENERATE_WORD_PARTS
| WordDelimiterFilter.STEM_ENGLISH_POSSESSIVE
| this.INDEX_ORIGINAL_TERM
| preserveOriginal
| WordDelimiterFilter.GENERATE_NUMBER_PARTS, null);
return new TokenStreamComponents(src, tok);
}

0 comments on commit 9f08518

Please sign in to comment.