Permalink
Browse files

Merge branch 'master' of https://github.com/nlalevee/elasticsearch

  • Loading branch information...
2 parents e707e93 + 3e76086 commit eadab43294dae72ccd7578934dd647e7d7afa8bc @kimchy kimchy committed Mar 8, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/main/java/org/elasticsearch/indices/analysis/IndicesAnalysisService.java
View
15 src/main/java/org/elasticsearch/indices/analysis/IndicesAnalysisService.java
@@ -67,6 +67,8 @@
import org.apache.lucene.analysis.shingle.ShingleFilter;
import org.apache.lucene.analysis.snowball.SnowballAnalyzer;
import org.apache.lucene.analysis.snowball.SnowballFilter;
+import org.apache.lucene.analysis.standard.ClassicAnalyzer;
+import org.apache.lucene.analysis.standard.ClassicTokenizer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.standard.StandardFilter;
import org.apache.lucene.analysis.standard.StandardTokenizer;
@@ -116,6 +118,7 @@ public IndicesAnalysisService(Settings settings) {
analyzerProviderFactories.put("stop", new PreBuiltAnalyzerProviderFactory("stop", AnalyzerScope.INDICES, new StopAnalyzer(Lucene.ANALYZER_VERSION)));
analyzerProviderFactories.put("whitespace", new PreBuiltAnalyzerProviderFactory("whitespace", AnalyzerScope.INDICES, new WhitespaceAnalyzer(Lucene.ANALYZER_VERSION)));
analyzerProviderFactories.put("simple", new PreBuiltAnalyzerProviderFactory("simple", AnalyzerScope.INDICES, new SimpleAnalyzer(Lucene.ANALYZER_VERSION)));
+ analyzerProviderFactories.put("classic", new PreBuiltAnalyzerProviderFactory("classic", AnalyzerScope.INDICES, new ClassicAnalyzer(Lucene.ANALYZER_VERSION)));
// extended ones
analyzerProviderFactories.put("pattern", new PreBuiltAnalyzerProviderFactory("pattern", AnalyzerScope.INDICES, new PatternAnalyzer(Lucene.ANALYZER_VERSION, Regex.compile("\\W+" /*PatternAnalyzer.NON_WORD_PATTERN*/, null), true, StopAnalyzer.ENGLISH_STOP_WORDS_SET)));
@@ -166,6 +169,18 @@ public Tokenizer create(Reader reader) {
}
}));
+ tokenizerFactories.put("classic", new PreBuiltTokenizerFactoryFactory(new TokenizerFactory() {
+ @Override
+ public String name() {
+ return "classic";
+ }
+
+ @Override
+ public Tokenizer create(Reader reader) {
+ return new ClassicTokenizer(Lucene.ANALYZER_VERSION, reader);
+ }
+ }));
+
tokenizerFactories.put("uax_url_email", new PreBuiltTokenizerFactoryFactory(new TokenizerFactory() {
@Override
public String name() {

0 comments on commit eadab43

Please sign in to comment.