Analyzer defaultAnalyzer = new PinyinAnalyzer(); Map<String,Analyzer> fieldAnalyzers = new HashMap<>(); //Defines an analyzer to use for the specified field. fieldAnalyzers.put("name",new StandardAnalyzer()); fieldAnalyzers.put("fieldName",new SmartChineseAnalyzer()); PerFieldAnalyzerWrapper analyzerWrapper = new PerFieldAnalyzerWrapper(defaultAnalyzer,fieldAnalyzers);