Package org.apache.solr.ltr.model
Class DefaultWrapperModel
java.lang.Object
org.apache.solr.ltr.model.LTRScoringModel
org.apache.solr.ltr.model.AdapterModel
org.apache.solr.ltr.model.WrapperModel
org.apache.solr.ltr.model.DefaultWrapperModel
- All Implemented Interfaces:
org.apache.lucene.util.Accountable
A scoring model that fetches the wrapped model from
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"
}
}
- See Also:
-
Field Summary
Fields inherited from class org.apache.solr.ltr.model.WrapperModel
modelFields inherited from class org.apache.solr.ltr.model.AdapterModel
solrResourceLoaderFields inherited from class org.apache.solr.ltr.model.LTRScoringModel
features, name, normsFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStreamvoidsetResource(String resource) toString()protected voidvalidate()Validate that settings make sense and throwsModelExceptionif they do not make sense.Methods inherited from class org.apache.solr.ltr.model.WrapperModel
equals, explain, getAllFeatures, getFeatures, getNormalizerExplanation, getNorms, hashCode, normalizeFeaturesInPlace, ramBytesUsed, score, updateModelMethods inherited from class org.apache.solr.ltr.model.AdapterModel
initMethods inherited from class org.apache.solr.ltr.model.LTRScoringModel
getFeatureStoreName, getInstance, getName, getParamsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
DefaultWrapperModel
-
-
Method Details
-
setResource
-
validate
Description copied from class:LTRScoringModelValidate that settings make sense and throwsModelExceptionif they do not make sense.- Overrides:
validatein classWrapperModel- Throws:
ModelException
-
fetchModelMap
- Specified by:
fetchModelMapin classWrapperModel- Throws:
ModelException
-
openInputStream
- Throws:
IOException
-
parseInputStream
- Throws:
IOException
-
toString
- Overrides:
toStringin classWrapperModel
-