org.apache.solr.analysis
Class CommonGramsQueryFilter

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.BufferedTokenStream
                  extended by org.apache.solr.analysis.CommonGramsQueryFilter

public class CommonGramsQueryFilter
extends BufferedTokenStream

Wrap a CommonGramsFilter optimizing phrase queries by only returning single words when they are not a member of a bigram. Example:


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
CommonGramsQueryFilter(CommonGramsFilter input)
          Constructor
 
Method Summary
 Token process(Token token)
          Output bigrams whenever possible to optimize queries.
 void reset()
           
 
Methods inherited from class org.apache.solr.analysis.BufferedTokenStream
next, output, peek, pushBack, read, write
 
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close, end
 
Methods inherited from class org.apache.lucene.analysis.TokenStream
getOnlyUseNewAPI, incrementToken, 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

CommonGramsQueryFilter

public CommonGramsQueryFilter(CommonGramsFilter input)
Constructor

Parameters:
input - must be a CommonGramsFilter!
Method Detail

reset

public void reset()
           throws IOException
Overrides:
reset in class BufferedTokenStream
Throws:
IOException

process

public Token process(Token token)
              throws IOException
Output bigrams whenever possible to optimize queries. Only output unigrams when they are not a member of a bigram. Example:


Copyright © 2010 Apache Software Foundation. All Rights Reserved.