org.elasticsearch.index.analysis.PinyinAnalyzer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-analysis-pinyin Show documentation
Show all versions of elasticsearch-analysis-pinyin Show documentation
Pinyin Analysis for Elasticsearch
package org.elasticsearch.index.analysis;
import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.analysis.PinyinConfig;
import org.elasticsearch.common.settings.Settings;
/**
* Created by IntelliJ IDEA.
* User: Medcl'
* Date: 12-5-22
* Time: 上午10:39
*/
public final class PinyinAnalyzer extends Analyzer {
private PinyinConfig config;
public PinyinAnalyzer(PinyinConfig config) {
this.config=config;
}
@Override
protected TokenStreamComponents createComponents(String fieldName) {
return new TokenStreamComponents(new PinyinTokenizer(config));
}
}