You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2011/01/17 12:08:36 UTC
svn commit: r1059871 - in /lucene/dev/branches/branch_3x: ./ lucene/ solr/
solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java
Author: rmuir
Date: Mon Jan 17 11:08:35 2011
New Revision: 1059871
URL: http://svn.apache.org/viewvc?rev=1059871&view=rev
Log:
SOLR-2259: warn if you are using a deprecated matchVersion constant
Modified:
lucene/dev/branches/branch_3x/ (props changed)
lucene/dev/branches/branch_3x/lucene/ (props changed)
lucene/dev/branches/branch_3x/solr/ (props changed)
lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java
Modified: lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java?rev=1059871&r1=1059870&r2=1059871&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java Mon Jan 17 11:08:35 2011
@@ -30,6 +30,8 @@ import org.apache.lucene.analysis.CharAr
import org.apache.lucene.analysis.StopFilter;
import org.apache.lucene.util.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Simple abstract implementation that handles init arg processing, is not really
@@ -45,6 +47,8 @@ abstract class BaseTokenStreamFactory {
/** the luceneVersion arg */
protected Version luceneMatchVersion = null;
+ public static final Logger log = LoggerFactory.getLogger(BaseTokenStreamFactory.class);
+
public void init(Map<String,String> args) {
this.args=args;
String matchVersion = args.get(IndexSchema.LUCENE_MATCH_VERSION_PARAM);
@@ -64,6 +68,10 @@ abstract class BaseTokenStreamFactory {
if (luceneMatchVersion == null) {
throw new RuntimeException("Configuration Error: Factory '" + this.getClass().getName() +
"' needs a 'luceneMatchVersion' parameter");
+ } else if (!luceneMatchVersion.onOrAfter(Version.LUCENE_30)) {
+ log.warn(getClass().getSimpleName() + " is using deprecated " + luceneMatchVersion +
+ " emulation. You should at some point declare and reindex to at least 3.0, because " +
+ "2.x emulation is deprecated and will be removed in 4.0");
}
}