Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-215 -- adding CHANGES.txt and moving the deprecation warning from BaseXXXFactory to IndexSchema.java

Ryan McKinley1f78c1be7671
diff --git a/CHANGES.txt b/CHANGES.txt
index 3eb91d8d5bb..ad7d70c9d2c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -197,6 +197,16 @@ Other Changes
3. Upgraded to Lucene 2.2.0; June 18, 2007.
+ 4. SOLR-215: In an push to support multiple SolrCores, the TokenizerFactory
+ and TokenFilterFactory initalization interface has changed to accept the
+ solrConfig. Initialization should happen in:
+ init(SolrConfig solrConfig, Map<String,String> args)
+ rather then:
+ init(Map<String,String> args)
+ Existing classes should continue to work, but it is encouraged to update
+ the initialization code.
+
+
================== Release 1.2, 20070602 ==================
Upgrading from Solr 1.1
diff --git a/src/java/org/apache/solr/analysis/BaseTokenizerFactory.java b/src/java/org/apache/solr/analysis/BaseTokenizerFactory.java
index e3a15de1bcd..d05d8278f93 100644
--- a/src/java/org/apache/solr/analysis/BaseTokenizerFactory.java
+++ b/src/java/org/apache/solr/analysis/BaseTokenizerFactory.java
@@ -35,7 +35,6 @@ public abstract class BaseTokenizerFactory implements TokenizerFactory, SolrConf
@Deprecated
public void init(Map<String,String> args) {
- //log.warning("calling the deprecated form of init; should be calling init(SolrConfig solrConfig, Map<String,String> args)");
this.args=args;
}
diff --git a/src/java/org/apache/solr/schema/IndexSchema.java b/src/java/org/apache/solr/schema/IndexSchema.java
index 9250b0ab73d..590ce1bcfc4 100644
--- a/src/java/org/apache/solr/schema/IndexSchema.java
+++ b/src/java/org/apache/solr/schema/IndexSchema.java
@@ -629,10 +629,13 @@ public final class IndexSchema {
NamedNodeMap attrs = node.getAttributes();
String className = DOMUtil.getAttr(attrs,"class","tokenizer");
TokenizerFactory tfac = (TokenizerFactory)solrConfig.newInstance(className);
- if (tfac instanceof SolrConfig.Initializable)
+ if (tfac instanceof SolrConfig.Initializable) {
((SolrConfig.Initializable)tfac).init(solrConfig, DOMUtil.toMapExcept(attrs,"class"));
- else
+ }
+ else {
+ log.warning("calling the deprecated form of init; should be calling init(SolrConfig solrConfig, Map<String,String> args) " + className );
tfac.init(DOMUtil.toMapExcept(attrs,"class"));
+ }
return tfac;
}
@@ -643,11 +646,13 @@ public final class IndexSchema {
NamedNodeMap attrs = node.getAttributes();
String className = DOMUtil.getAttr(attrs,"class","token filter");
TokenFilterFactory tfac = (TokenFilterFactory)solrConfig.newInstance(className);
- if (tfac instanceof SolrConfig.Initializable)
+ if (tfac instanceof SolrConfig.Initializable) {
((SolrConfig.Initializable)tfac).init(solrConfig, DOMUtil.toMapExcept(attrs,"class"));
- else
+ }
+ else {
+ log.warning("calling the deprecated form of init; should be calling init(SolrConfig solrConfig, Map<String,String> args) " + className );
tfac.init(DOMUtil.toMapExcept(attrs,"class"));
-
+ }
return tfac;
}