com.jivesoftware.util.search
Class SynonymFilter
java.lang.Object
org.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.TokenFilter
com.jivesoftware.util.search.SynonymFilter
public class SynonymFilter
- extends org.apache.lucene.analysis.TokenFilter
Lucene filter for creating synonym matching behavior such that a search for cold would also
search for frigid, freeze, etc
Source code based on code obtained from Lucene article in JDJ, Volume 7 Issue 12
Fields inherited from class org.apache.lucene.analysis.TokenFilter |
input |
Constructor Summary |
SynonymFilter(org.apache.lucene.analysis.TokenStream in)
|
Method Summary |
static void |
addAliases(java.util.List aliases)
Add a list of aliases. |
static java.util.List |
getAliasLists()
Return the aliases as a List of Lists of aliases. |
org.apache.lucene.analysis.Token |
next()
|
static void |
removeAliases(java.util.List aliases)
Remove a key completely from the alias list. |
Methods inherited from class org.apache.lucene.analysis.TokenFilter |
close |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TOKEN_TYPE_SYNONYM
public static final java.lang.String TOKEN_TYPE_SYNONYM
- See Also:
- Constant Field Values
SynonymFilter
public SynonymFilter(org.apache.lucene.analysis.TokenStream in)
getAliasLists
public static java.util.List getAliasLists()
- Return the aliases as a List of Lists of aliases.
- Returns:
- the aliases as a List of Lists of aliases.
addAliases
public static void addAliases(java.util.List aliases)
- Add a list of aliases.
- Parameters:
aliases
- a list of strings for words that are aliases of each other
removeAliases
public static void removeAliases(java.util.List aliases)
- Remove a key completely from the alias list.
- Parameters:
aliases
- a list of strings for words that are aliases of each other to remove
next
public org.apache.lucene.analysis.Token next()
throws java.io.IOException
- Specified by:
next
in class org.apache.lucene.analysis.TokenStream
- Throws:
java.io.IOException
Copyright © 1999-2006 Jive Software.