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)modelsolrResourceLoaderfeatures, name, normsNULL_ACCOUNTABLE| 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, ramBytesUsed, score, updateModelinitgetFeatureStoreName, getInstance, getName, getParamsclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildResourcespublic void setResource(String resource)
protected void validate()
throws ModelException
LTRScoringModelModelException if they do not make sense.validate in class WrapperModelModelExceptionpublic Map<String,Object> fetchModelMap() throws ModelException
fetchModelMap in class WrapperModelModelExceptionprotected InputStream openInputStream() throws IOException
IOExceptionprotected Map<String,Object> parseInputStream(InputStream in) throws IOException
IOExceptionpublic String toString()
toString in class WrapperModelCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.