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
All Implemented Interfaces:
java.io.Closeable

public final class KeepWordFilter
extends org.apache.lucene.analysis.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 940806 2010-05-04 11:18:46Z uschindler $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
org.apache.lucene.util.AttributeSource.AttributeFactory, org.apache.lucene.util.AttributeSource.State
 
Field Summary
 
Fields inherited from class org.apache.lucene.analysis.TokenFilter
input
 
Constructor Summary
KeepWordFilter(org.apache.lucene.analysis.TokenStream in, org.apache.lucene.analysis.CharArraySet words)
          The words set passed to this constructor will be directly used by this filter and should not be modified,
KeepWordFilter(org.apache.lucene.analysis.TokenStream in, java.util.Set<java.lang.String> words, boolean ignoreCase)
          Deprecated. Use KeepWordFilter(TokenStream, Set, boolean) instead
 
Method Summary
 boolean incrementToken()
           
 
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close, end, reset
 
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

@Deprecated
public KeepWordFilter(org.apache.lucene.analysis.TokenStream in,
                                 java.util.Set<java.lang.String> words,
                                 boolean ignoreCase)
Deprecated. Use KeepWordFilter(TokenStream, Set, boolean) instead


KeepWordFilter

public KeepWordFilter(org.apache.lucene.analysis.TokenStream in,
                      org.apache.lucene.analysis.CharArraySet words)
The words set passed to this constructor will be directly used by this filter and should not be modified,

Method Detail

incrementToken

public boolean incrementToken()
                       throws java.io.IOException
Specified by:
incrementToken in class org.apache.lucene.analysis.TokenStream
Throws:
java.io.IOException


Copyright © 2006-2010 Hibernate. All Rights Reserved.