diff --git a/CHANGES.txt b/CHANGES.txt index d26c47fa1df..3d7de5a0a95 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -50,6 +50,14 @@ information, see SOLR-1377. If spellcheck.extendedResults=true, the response format for suggestions has changed, see SOLR-1071. +Use of the "charset" option when configuring the following Analysis +Factories has been deprecated and will cause a warning to be logged. +In future versions of Solr attempting to use this option will cause an +error. See SOLR-1410 for more information. + * GreekLowerCaseFilterFactory + * RussianStemFilterFactory + * RussianLowerCaseFilterFactory + * RussianLetterTokenizerFactory Versions of Major Components ---------------------------- @@ -660,12 +668,17 @@ Other Changes 44. Upgraded to Lucene 2.9-dev r801856 (Mark Miller) -45. SOLR1276: Added StatsComponentTest (Rafał Kuć, gsingers) +45. SOLR1276: Added StatsComponentTest (Rafał Kuć, gsingers) 46. SOLR-1377: The TokenizerFactory API has changed to explicitly return a Tokenizer rather then a TokenStream (that may be or may not be a Tokenizer). This change is required to take advantage of the Token reuse improvements in lucene 2.9. (ryan) +47. SOLR-1410: Log a warning if the deprecated charset option is used + on GreekLowerCaseFilterFactory, RussianStemFilterFactory, + RussianLowerCaseFilterFactory or RussianLetterTokenizerFactory. + (Robert Muir via hossman) + Build ---------------------- @@ -683,7 +696,7 @@ Build Documentation ---------------------- - 1. SOLR-789: The javadoc of RandomSortField is not readable (Nicolas Lalevée via koji) + 1. SOLR-789: The javadoc of RandomSortField is not readable (Nicolas LalevÁe via koji) 2. SOLR-962: Note about null handling in ModifiableSolrParams.add javadoc (Kay Kay via hossman) @@ -1122,7 +1135,7 @@ Bug Fixes 9. SOLR-294: Logging of elapsed time broken on Solaris because the date command there does not support the %s output format. (bill) -10. SOLR-136: Snappuller - "date -d" and locales don't mix. (Jürgen Hermann via bill) +10. SOLR-136: Snappuller - "date -d" and locales don't mix. (JÁrgen Hermann via bill) 11. SOLR-333: Changed distributiondump.jsp to use Solr HOME instead of CWD to set path. diff --git a/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java b/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java index 4cfd7117d72..3ebe43e868b 100644 --- a/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java +++ b/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java @@ -27,9 +27,12 @@ import org.apache.lucene.analysis.el.GreekCharsets; import org.apache.lucene.analysis.el.GreekLowerCaseFilter; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class GreekLowerCaseFilterFactory extends BaseTokenFilterFactory { + @Deprecated private static Map CHARSETS = new HashMap(); static { CHARSETS.put("UnicodeGreek",GreekCharsets.UnicodeGreek); @@ -39,12 +42,23 @@ public class GreekLowerCaseFilterFactory extends BaseTokenFilterFactory private char[] charset = GreekCharsets.UnicodeGreek; + private static Logger logger = LoggerFactory.getLogger(GreekLowerCaseFilterFactory.class); @Override public void init(Map args) { super.init(args); String charsetName = args.get("charset"); - if (null != charsetName) charset = CHARSETS.get(charsetName); + if (null != charsetName) { + charset = CHARSETS.get(charsetName); + if (charset.equals(GreekCharsets.UnicodeGreek)) + logger.warn("Specifying UnicodeGreek is no longer required (default). " + + "Use of the charset parameter will cause an error in Solr 1.5"); + else + logger.warn("Support for this custom encoding is deprecated. " + + "Use of the charset parameter will cause an error in Solr 1.5"); + } else { + charset = GreekCharsets.UnicodeGreek; /* default to unicode */ + } if (null == charset) { throw new SolrException(ErrorCode.SERVER_ERROR, "Don't understand charset: " + charsetName); diff --git a/src/java/org/apache/solr/analysis/RussianCommon.java b/src/java/org/apache/solr/analysis/RussianCommon.java index 839211e0d3c..a897de5d7fe 100644 --- a/src/java/org/apache/solr/analysis/RussianCommon.java +++ b/src/java/org/apache/solr/analysis/RussianCommon.java @@ -23,8 +23,14 @@ import java.util.HashMap; import org.apache.solr.core.SolrConfig; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Deprecated public class RussianCommon { + private static Logger logger = LoggerFactory.getLogger(RussianCommon.class); + private static Map CHARSETS = new HashMap(); static { CHARSETS.put("UnicodeRussian",RussianCharsets.UnicodeRussian); @@ -37,6 +43,14 @@ public class RussianCommon { return RussianCharsets.UnicodeRussian; char[] charset = CHARSETS.get(name); + + if (charset.equals(RussianCharsets.UnicodeRussian)) + logger.warn("Specifying UnicodeRussian is no longer required (default). " + + "Use of the charset parameter will cause an error in Solr 1.5"); + else + logger.warn("Support for this custom encoding is deprecated. " + + "Use of the charset parameter will cause an error in Solr 1.5"); + if (null == charset) { throw new SolrException(ErrorCode.SERVER_ERROR, "Don't understand charset: " + name); diff --git a/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java b/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java index 3e6450c8e02..3ab814c12f9 100644 --- a/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java +++ b/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java @@ -23,7 +23,7 @@ import java.util.Map; import org.apache.lucene.analysis.ru.RussianLetterTokenizer; public class RussianLetterTokenizerFactory extends BaseTokenizerFactory { - + @Deprecated private char[] charset; @Override diff --git a/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java b/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java index 83061dfb964..142dc6194d4 100644 --- a/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java +++ b/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java @@ -23,7 +23,7 @@ import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ru.RussianLowerCaseFilter; public class RussianLowerCaseFilterFactory extends BaseTokenFilterFactory { - + @Deprecated private char[] charset; @Override diff --git a/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java b/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java index 82157d2dbb2..4798ad7afe0 100644 --- a/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java +++ b/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java @@ -25,7 +25,7 @@ import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ru.RussianStemFilter; public class RussianStemFilterFactory extends BaseTokenFilterFactory { - + @Deprecated private char[] charset; public void init(Map args) {