mirror of https://github.com/apache/lucene.git
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:
parent
f8d37b166f
commit
847bb71cdf
|
@ -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() {
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue