org.apache.solr.analysis
Class KeepWordFilter

java.lang.Object
  extended by org.apache.lucene.util.AttributeSource
      extended by org.apache.lucene.analysis.TokenStream
          extended by org.apache.lucene.analysis.TokenFilter
              extended by org.apache.solr.analysis.KeepWordFilter

public final class KeepWordFilter
extends TokenFilter

A TokenFilter that only keeps tokens with text contained in the required words. This filter behaves like the inverse of StopFilter.

Since:
solr 1.3
Version:
$Id: KeepWordFilter.java 804726 2009-08-16 17:28:58Z yonik $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
AttributeSource.AttributeFactory, AttributeSource.State
 
Field Summary
 
Fields inherited from class org.apache.lucene.analysis.TokenFilter
input
 
Constructor Summary
KeepWordFilter(TokenStream in, Set<String> words, boolean ignoreCase)
           
 
Method Summary
 boolean incrementToken()
           
 
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close, end, reset
 
Methods inherited from class org.apache.lucene.analysis.TokenStream
getOnlyUseNewAPI, next, next, setOnlyUseNewAPI
 
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, restoreState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeepWordFilter

public KeepWordFilter(TokenStream in,
                      Set<String> words,
                      boolean ignoreCase)
Method Detail

incrementToken

public boolean incrementToken()
                       throws IOException
Overrides:
incrementToken in class TokenStream
Throws:
IOException


Copyright © 2011 Apache Software Foundation. All Rights Reserved.