com.atlassian.jira.issue.index.analyzer
Class WildcardFilter

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 com.atlassian.jira.issue.index.analyzer.WildcardFilter
All Implemented Interfaces:
Closeable

public class WildcardFilter
extends org.apache.lucene.analysis.TokenFilter

This Filter adds wildcards to the tokens returned by standard filters.

It can be difficult to do wild card search over a stemmed index - for example 'feature' will be stemmed to feature and if you search for 'feature*' you will not match 'feature'. To search for 'feature*' then stem first and then wildcard. The need for this was highlighted by (JRA-19918) This filter stems and then appends the wildcard to each existing token, so it makes no sense for it not to be the final filter in the chain. note that the query returned will actually not work (it will look for the litral * as it is a term query - use the query to get the text and then search)

Since:
v4.3

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
static char WILDCARD_OPERATOR
          Wildcrad character: U+002A (ASTERISK)
 
Fields inherited from class org.apache.lucene.analysis.TokenFilter
input
 
Constructor Summary
WildcardFilter(org.apache.lucene.analysis.TokenStream in)
           
 
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, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

WILDCARD_OPERATOR

public static final char WILDCARD_OPERATOR
Wildcrad character: U+002A (ASTERISK)

See Also:
Constant Field Values
Constructor Detail

WildcardFilter

public WildcardFilter(org.apache.lucene.analysis.TokenStream in)
Method Detail

incrementToken

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


Copyright © 2002-2013 Atlassian. All Rights Reserved.