Skip to content

Apache Lucene open-source search software

SOLR-1109: PhoneticFilterFactory doesn't handle maxCodeLength param

Yonik Seeley918860396b8a
diff --git a/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java b/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java
index d914d19ca9a..e3845188f34 100644
--- a/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java
+++ b/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java
@@ -82,12 +82,12 @@ public class PhoneticFilterFactory extends BaseTokenFilterFactory
// Try to set the maxCodeLength
String v = args.get( "maxCodeLength" );
if( v != null ) {
- Method setter = encoder.getClass().getMethod( "setMaxCodeLength", Integer.class );
+ Method setter = encoder.getClass().getMethod( "setMaxCodeLen", int.class );
setter.invoke( encoder, Integer.parseInt( v ) );
}
}
catch (Exception e) {
- throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "Error initializing: "+name + "/"+clazz, e );
+ throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "Error initializing: "+name + "/"+clazz, e , false);
}
}