org.apache.solr.analysis
Class KeepWordFilterFactory

java.lang.Object
  extended by org.apache.solr.analysis.BaseTokenFilterFactory
      extended by org.apache.solr.analysis.KeepWordFilterFactory
All Implemented Interfaces:
TokenFilterFactory, ResourceLoaderAware

public class KeepWordFilterFactory
extends BaseTokenFilterFactory
implements ResourceLoaderAware

Since:
solr 1.3
Version:
$Id: KeepWordFilterFactory.java 929782 2010-04-01 02:15:27Z rmuir $

Field Summary
protected  Map<String,String> args
          The init args
protected  org.apache.lucene.util.Version luceneMatchVersion
          the luceneVersion arg
 
Fields inherited from class org.apache.solr.analysis.BaseTokenFilterFactory
log
 
Constructor Summary
KeepWordFilterFactory()
           
 
Method Summary
protected  void assureMatchVersion()
          this method can be called in the #create method, to inform user, that for this factory a luceneMatchVersion is required
 KeepWordFilter create(org.apache.lucene.analysis.TokenStream input)
          Transform the specified input TokenStream
 Map<String,String> getArgs()
           
protected  boolean getBoolean(String name, boolean defaultVal)
           
protected  boolean getBoolean(String name, boolean defaultVal, boolean useDefault)
           
protected  int getInt(String name)
           
protected  int getInt(String name, int defaultVal)
           
protected  int getInt(String name, int defaultVal, boolean useDefault)
           
 org.apache.lucene.analysis.CharArraySet getWords()
           
protected  org.apache.lucene.analysis.CharArraySet getWordSet(ResourceLoader loader, String wordFiles, boolean ignoreCase)
           
 void inform(ResourceLoader loader)
           
 void init(Map<String,String> args)
           
 boolean isIgnoreCase()
           
 void setIgnoreCase(boolean ignoreCase)
           
 void setWords(Set<String> words)
          Set the keep word list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.solr.analysis.TokenFilterFactory
getArgs, init
 

Field Detail

args

protected Map<String,String> args
The init args


luceneMatchVersion

protected org.apache.lucene.util.Version luceneMatchVersion
the luceneVersion arg

Constructor Detail

KeepWordFilterFactory

public KeepWordFilterFactory()
Method Detail

inform

public void inform(ResourceLoader loader)
Specified by:
inform in interface ResourceLoaderAware

setWords

public void setWords(Set<String> words)
Set the keep word list. NOTE: if ignoreCase==true, the words are expected to be lowercase


setIgnoreCase

public void setIgnoreCase(boolean ignoreCase)

create

public KeepWordFilter create(org.apache.lucene.analysis.TokenStream input)
Description copied from interface: TokenFilterFactory
Transform the specified input TokenStream

Specified by:
create in interface TokenFilterFactory

getWords

public org.apache.lucene.analysis.CharArraySet getWords()

isIgnoreCase

public boolean isIgnoreCase()

init

public void init(Map<String,String> args)

getArgs

public Map<String,String> getArgs()

assureMatchVersion

protected final void assureMatchVersion()
this method can be called in the #create method, to inform user, that for this factory a luceneMatchVersion is required


getInt

protected int getInt(String name)

getInt

protected int getInt(String name,
                     int defaultVal)

getInt

protected int getInt(String name,
                     int defaultVal,
                     boolean useDefault)

getBoolean

protected boolean getBoolean(String name,
                             boolean defaultVal)

getBoolean

protected boolean getBoolean(String name,
                             boolean defaultVal,
                             boolean useDefault)

getWordSet

protected org.apache.lucene.analysis.CharArraySet getWordSet(ResourceLoader loader,
                                                             String wordFiles,
                                                             boolean ignoreCase)
                                                      throws IOException
Throws:
IOException


Copyright © 2006-2011 Hibernate. All Rights Reserved.