public class DefaultWrapperModel extends WrapperModel
SolrResourceLoader
.
This model uses SolrResourceLoader.openResource(String)
for fetching the wrapped model.
If you give a relative path for params/resource
, this model will try to load the wrapped model from
the instance directory (i.e. ${solr.solr.home}). Otherwise, seek through classpaths.
Example configuration:
{ "class": "org.apache.solr.ltr.model.DefaultWrapperModel", "name": "myWrapperModelName", "params": { "resource": "models/myModel.json" } }
SolrResourceLoader.openResource(String)
model
solrResourceLoader
features, name, norms
Constructor and Description |
---|
DefaultWrapperModel(String name,
List<Feature> features,
List<Normalizer> norms,
String featureStoreName,
List<Feature> allFeatures,
Map<String,Object> params) |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
fetchModelMap() |
protected InputStream |
openInputStream() |
protected Map<String,Object> |
parseInputStream(InputStream in) |
void |
setResource(String resource) |
String |
toString() |
protected void |
validate()
Validate that settings make sense and throws
ModelException if they do not make sense. |
equals, explain, getAllFeatures, getFeatures, getNormalizerExplanation, getNorms, hashCode, normalizeFeaturesInPlace, score, updateModel
init
getFeatureStoreName, getInstance, getName, getParams
public void setResource(String resource)
protected void validate() throws ModelException
LTRScoringModel
ModelException
if they do not make sense.validate
in class WrapperModel
ModelException
public Map<String,Object> fetchModelMap() throws ModelException
fetchModelMap
in class WrapperModel
ModelException
protected InputStream openInputStream() throws IOException
IOException
protected Map<String,Object> parseInputStream(InputStream in) throws IOException
IOException
public String toString()
toString
in class WrapperModel
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.