SOLR-2909: add support for ResourceLoaderAware tokenizerFactories in synonym filter factories

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Koji Sekiguchi 2012-02-21 00:56:42 +00:00
parent 314bce4f6e
commit 3ab34fc0d0
3 changed files with 9 additions and 0 deletions

View File

@ -608,6 +608,9 @@ Bug Fixes
* SOLR-3052: Fixed typo in distributed grouping parameters.
(Martijn van Groningen, Grant Ingersoll)
* SOLR-2909: Add support for ResourceLoaderAware tokenizerFactories in synonym
filter factories. (Tom Klonikowski, Jun Ohtani via Koji Sekiguchi)
Other Changes
----------------------
* SOLR-2922: Upgrade commons-io and commons-lang to 2.1 and 2.6, respectively. (koji)

View File

@ -157,6 +157,9 @@ final class FSTSynonymFilterFactory extends BaseTokenFilterFactory implements Re
private static TokenizerFactory loadTokenizerFactory(ResourceLoader loader, String cname, Map<String,String> args){
TokenizerFactory tokFactory = (TokenizerFactory) loader.newInstance(cname);
tokFactory.init(args);
if (tokFactory instanceof ResourceLoaderAware) {
((ResourceLoaderAware) tokFactory).inform(loader);
}
return tokFactory;
}
}

View File

@ -171,6 +171,9 @@ final class SlowSynonymFilterFactory extends BaseTokenFilterFactory implements R
private static TokenizerFactory loadTokenizerFactory(ResourceLoader loader, String cname, Map<String,String> args){
TokenizerFactory tokFactory = (TokenizerFactory)loader.newInstance( cname );
tokFactory.init( args );
if (tokFactory instanceof ResourceLoaderAware) {
((ResourceLoaderAware) tokFactory).inform(loader);
}
return tokFactory;
}