org.apache.solr.analysis
Class ReversedWildcardFilterFactory

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

public class ReversedWildcardFilterFactory
extends BaseTokenFilterFactory

Factory for ReversedWildcardFilter-s. When this factory is added to an analysis chain, it will be used both for filtering the tokens during indexing, and to determine the query processing of this field during search.

This class supports the following init arguments:

Note 1: This filter always reverses input tokens during indexing. Note 2: Query tokens without wildcard characters will never be reversed.


Field Summary
 
Fields inherited from class org.apache.solr.analysis.BaseTokenFilterFactory
args, log
 
Constructor Summary
ReversedWildcardFilterFactory()
           
 
Method Summary
 TokenStream create(TokenStream input)
          Transform the specified input TokenStream
protected  float getFloat(String name, float defValue)
           
 char getMarkerChar()
           
 void init(Map<String,String> args)
          init will be called just once, immediately after creation.
 boolean shouldReverse(String token)
          This method encapsulates the logic that determines whether a query token should be reversed in order to use the reversed terms in the index.
 
Methods inherited from class org.apache.solr.analysis.BaseTokenFilterFactory
getArgs, getBoolean, getBoolean, getInt, getInt, getInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReversedWildcardFilterFactory

public ReversedWildcardFilterFactory()
Method Detail

init

public void init(Map<String,String> args)
Description copied from interface: TokenFilterFactory
init will be called just once, immediately after creation.

The args are user-level initialization parameters that may be specified when declaring the factory in the schema.xml

Specified by:
init in interface TokenFilterFactory
Overrides:
init in class BaseTokenFilterFactory

create

public TokenStream create(TokenStream input)
Description copied from interface: TokenFilterFactory
Transform the specified input TokenStream


shouldReverse

public boolean shouldReverse(String token)
This method encapsulates the logic that determines whether a query token should be reversed in order to use the reversed terms in the index.

Parameters:
token - input token.
Returns:
true if input token should be reversed, false otherwise.

getMarkerChar

public char getMarkerChar()

getFloat

protected float getFloat(String name,
                         float defValue)


Copyright © 2009 Apache Software Foundation. All Rights Reserved.