Example usage for org.apache.lucene.analysis.core StopFilterFactory StopFilterFactory

List of usage examples for org.apache.lucene.analysis.core StopFilterFactory StopFilterFactory

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.core StopFilterFactory StopFilterFactory.

Prototype

public StopFilterFactory(Map<String, String> args) 

Source Link

Document

Creates a new StopFilterFactory

Usage

From source file:uk.gov.nationalarchives.discovery.taxonomy.common.config.LuceneIAViewConfiguration.java

License:Mozilla Public License

/**
 ************************* FilterFactories and Analyzers
 *//*from  w ww .  jav a2 s . c  o m*/

public @Bean StopFilterFactory stopFilterFactory() {
    Map<String, String> stopFilterArgs = new HashMap<String, String>();
    stopFilterArgs.put("words", "stopwords.txt");
    stopFilterArgs.put("enablePositionIncrements", "true");
    stopFilterArgs.put("luceneMatchVersion", version);

    StopFilterFactory stopFilterFactory = new StopFilterFactory(stopFilterArgs);

    try {
        ResourceLoader loader = new ClasspathResourceLoader(getClass());
        stopFilterFactory.inform(loader);
    } catch (IOException e) {
        logger.error(".stopFilterFactory: an error occured while creating the Filter factory: {}",
                e.getMessage());
    }
    return stopFilterFactory;
}