lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r812760 - in /lucene/solr/trunk: ./ src/java/org/apache/solr/analysis/
Date Wed, 09 Sep 2009 03:58:13 GMT
Author: hossman
Date: Wed Sep  9 03:58:12 2009
New Revision: 812760

URL: http://svn.apache.org/viewvc?rev=812760&view=rev
Log:
SOLR-1410: warn if deprecated charset option is used in greek and russian analysis factories

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java
    lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianCommon.java
    lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java
    lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java
    lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=812760&r1=812759&r2=812760&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Wed Sep  9 03:58:12 2009
@@ -50,6 +50,14 @@
 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 @@
 
 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 @@
 
 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 @@
  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.
  

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java?rev=812760&r1=812759&r2=812760&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java Wed
Sep  9 03:58:12 2009
@@ -27,9 +27,12 @@
 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<String,char[]> CHARSETS = new HashMap<String,char[]>();
   static {
     CHARSETS.put("UnicodeGreek",GreekCharsets.UnicodeGreek);
@@ -39,12 +42,23 @@
   
   private char[] charset = GreekCharsets.UnicodeGreek;
 
+  private static Logger logger = LoggerFactory.getLogger(GreekLowerCaseFilterFactory.class);
   
   @Override
   public void init(Map<String, String> 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);

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianCommon.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianCommon.java?rev=812760&r1=812759&r2=812760&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianCommon.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianCommon.java Wed Sep  9 03:58:12
2009
@@ -23,8 +23,14 @@
 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<String,char[]> CHARSETS = new HashMap<String,char[]>();
   static {
     CHARSETS.put("UnicodeRussian",RussianCharsets.UnicodeRussian);
@@ -37,6 +43,14 @@
       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);

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java?rev=812760&r1=812759&r2=812760&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java
(original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLetterTokenizerFactory.java
Wed Sep  9 03:58:12 2009
@@ -23,7 +23,7 @@
 import org.apache.lucene.analysis.ru.RussianLetterTokenizer;
 
 public class RussianLetterTokenizerFactory extends BaseTokenizerFactory {
-  
+  @Deprecated
   private char[] charset;
   
   @Override

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java?rev=812760&r1=812759&r2=812760&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java
(original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianLowerCaseFilterFactory.java
Wed Sep  9 03:58:12 2009
@@ -23,7 +23,7 @@
 import org.apache.lucene.analysis.ru.RussianLowerCaseFilter;
 
 public class RussianLowerCaseFilterFactory extends BaseTokenFilterFactory {
-  
+  @Deprecated
   private char[] charset;
   
   @Override

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java?rev=812760&r1=812759&r2=812760&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/RussianStemFilterFactory.java Wed
Sep  9 03:58:12 2009
@@ -25,7 +25,7 @@
 import org.apache.lucene.analysis.ru.RussianStemFilter;
 
 public class RussianStemFilterFactory extends BaseTokenFilterFactory {
-  
+  @Deprecated
   private char[] charset;
   
   public void init(Map<String, String> args) {



Mime
View raw message