mirror of https://github.com/apache/lucene.git
Merged revision(s) 1672531 from lucene/dev/branches/branch_5x:
SOLR-7373: let AbstractSpatialFieldType set the context ........ git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1672533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6bed01b2ae
commit
a2d29b8e12
|
@ -113,11 +113,13 @@ public abstract class AbstractSpatialFieldType<T extends SpatialStrategy> extend
|
|||
protected void init(IndexSchema schema, Map<String, String> args) {
|
||||
super.init(schema, args);
|
||||
|
||||
//Solr expects us to remove the parameters we've used.
|
||||
MapListener<String, String> argsWrap = new MapListener<>(args);
|
||||
ctx = SpatialContextFactory.makeSpatialContext(argsWrap, schema.getResourceLoader().getClassLoader());
|
||||
args.keySet().removeAll(argsWrap.getSeenKeys());
|
||||
|
||||
if(ctx==null) { // subclass can set this directly
|
||||
//Solr expects us to remove the parameters we've used.
|
||||
MapListener<String, String> argsWrap = new MapListener<>(args);
|
||||
ctx = SpatialContextFactory.makeSpatialContext(argsWrap, schema.getResourceLoader().getClassLoader());
|
||||
args.keySet().removeAll(argsWrap.getSeenKeys());
|
||||
}
|
||||
|
||||
final String unitsErrMsg = "units parameter is deprecated, please use distanceUnits instead for field types with class " +
|
||||
getClass().getSimpleName();
|
||||
this.units = args.remove("units");//deprecated
|
||||
|
|
Loading…
Reference in New Issue