Package de.arago.lucene.util

Source Code of de.arago.lucene.util.MultiAnalyzerFactory

package de.arago.lucene.util;

import de.arago.lucene.api.AnalyzerFactory;
import java.util.Properties;
import org.apache.lucene.analysis.Analyzer;
import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.analysis.core.KeywordAnalyzer;
import org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper;

public class MultiAnalyzerFactory implements AnalyzerFactory {
    @Override
    public Analyzer create(Properties p) {
        KeywordAnalyzer defaultAnalyzer = new KeywordAnalyzer();
        Map analyzers = new HashMap();

        analyzers.put("_name_prefix", new LowCaseAnalyzer());


        return new PerFieldAnalyzerWrapper(defaultAnalyzer, analyzers);
    }
}
TOP

Related Classes of de.arago.lucene.util.MultiAnalyzerFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.