SOLR-4007: Morfologik dictionaries not available in Solr field type

due to class loader lookup problems. (Lance Norskog, Dawid Weiss)



git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1404042 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dawid Weiss 2012-10-31 09:04:04 +00:00
parent f8d37b166f
commit 847bb71cdf
2 changed files with 15 additions and 3 deletions

View File

@ -67,9 +67,18 @@ public class MorfologikFilter extends TokenFilter {
public MorfologikFilter(final TokenStream in, final DICTIONARY dict, final Version version) {
super(in);
this.input = in;
this.stemmer = new PolishStemmer(dict);
this.charUtils = CharacterUtils.getInstance(version);
this.lemmaList = Collections.emptyList();
// SOLR-4007: temporarily substitute context class loader to allow finding dictionary resources.
Thread me = Thread.currentThread();
ClassLoader cl = me.getContextClassLoader();
try {
me.setContextClassLoader(PolishStemmer.class.getClassLoader());
this.stemmer = new PolishStemmer(dict);
this.charUtils = CharacterUtils.getInstance(version);
this.lemmaList = Collections.emptyList();
} finally {
me.setContextClassLoader(cl);
}
}
private void popNextLemma() {

View File

@ -81,6 +81,9 @@ Optimizations
Bug Fixes
----------------------
* SOLR-4007: Morfologik dictionaries not available in Solr field type
due to class loader lookup problems. (Lance Norskog, Dawid Weiss)
* SOLR-3560: Handle different types of Exception Messages for Logging UI
(steffkes)