Global.helma.Search.getAnalyzer (key)
Returns a new Analyzer instance depending on the key passed as argument. Currently supported arguments are "br" (BrazilianAnalyzer), "cn" (ChineseAnalyzer), "cz" (CzechAnalyzer), "nl" (DutchAnalyzer), "fr" (FrenchAnalyzer), "de" (GermanAnalyzer), "el" (GreekAnalyzer), "keyword" (KeywordAnalyzer), "ru" (RussianAnalyzer), "simple" (SimpleAnalyzer), "snowball" (SnowballAnalyzer), "stop" (StopAnalyzer) "whitespace" (WhitespaceAnalyzer). If no argument is given, a StandardAnalyzer is returned.

  • Parameter {String}:
    key The key identifying the analyzer
  • Returns
    A newly created Analyzer instance
Sourcecode in /home/hannes/helma/modules/helma/Search.js:
80:   helma.Search.getAnalyzer = function(key) {
81:       var pkg = Packages.org.apache.lucene;
82:       switch (key) {
83:           case "br":
84:               return new pkg.analysis.br.BrazilianAnalyzer();
85:           case "cn":
86:               return new pkg.analysis.cn.ChineseAnalyzer();
87:           case "cz":
88:               return new pkg.analysis.cz.CzechAnalyzer();
89:          case "nl":
90:              return new pkg.analysis.nl.DutchAnalyzer();
91:          case "fr":
92:              return new pkg.analysis.fr.FrenchAnalyzer();
93:          case "de":
94:              return new pkg.analysis.de.GermanAnalyzer();
95:          case "el":
96:              return new pkg.analysis.el.GreekAnalyzer();
97:          case "keyword":
98:              return new pkg.analysis.KeywordAnalyzer();
99:          case "ru":
100:              return new pkg.analysis.ru.RussianAnalyzer();
101:          case "simple":
102:              return new pkg.analysis.SimpleAnalyzer();
103:          case "snowball":
104:              return new pkg.analysis.snowball.SnowballAnalyzer();
105:          case "stop":
106:              return new pkg.analysis.StopAnalyzer();
107:          case "whitespace":
108:              return new pkg.analysis.WhitespaceAnalyzer();
109:          default:
110:              return new pkg.analysis.standard.StandardAnalyzer();
111:      }
112:  }