Package org.apache.solr.ltr.feature
Class SolrFeature
- java.lang.Object
- 
- org.apache.lucene.search.Query
- 
- org.apache.solr.ltr.feature.Feature
- 
- org.apache.solr.ltr.feature.SolrFeature
 
 
 
- 
 public class SolrFeature extends Feature This feature allows you to reuse any Solr query as a feature. The value of the feature will be the score of the given query for the current document. See Solr documentation of other parsers you can use as a feature. Example configurations:[{ "name": "isBook", "class": "org.apache.solr.ltr.feature.SolrFeature", "params":{ "fq": ["{!terms f=category}book"] } }, { "name": "documentRecency", "class": "org.apache.solr.ltr.feature.SolrFeature", "params": { "q": "{!func}recip( ms(NOW,publish_date), 3.16e-11, 1, 1)" } }]
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classSolrFeature.SolrFeatureWeightWeight for a SolrFeature- 
Nested classes/interfaces inherited from class org.apache.solr.ltr.feature.FeatureFeature.FeatureWeight
 
- 
 - 
Constructor SummaryConstructors Constructor Description SolrFeature(String name, Map<String,Object> params)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Feature.FeatureWeightcreateWeight(org.apache.lucene.search.IndexSearcher searcher, boolean needsScores, SolrQueryRequest request, org.apache.lucene.search.Query originalQuery, Map<String,String[]> efi)StringgetDf()List<String>getFq()StringgetQ()LinkedHashMap<String,Object>paramsToMap()voidsetDf(String df)voidsetFq(List<String> fq)voidsetQ(String q)protected voidvalidate()As part of creation of a feature instance, this function confirms that the feature parameters are valid.- 
Methods inherited from class org.apache.solr.ltr.feature.Featureequals, getDefaultValue, getIndex, getInstance, getName, hashCode, setDefaultValue, setIndex, toString
 
- 
 
- 
- 
- 
Method Detail- 
getDfpublic String getDf() 
 - 
setDfpublic void setDf(String df) 
 - 
getQpublic String getQ() 
 - 
setQpublic void setQ(String q) 
 - 
paramsToMappublic LinkedHashMap<String,Object> paramsToMap() - Specified by:
- paramsToMapin class- Feature
 
 - 
createWeightpublic Feature.FeatureWeight createWeight(org.apache.lucene.search.IndexSearcher searcher, boolean needsScores, SolrQueryRequest request, org.apache.lucene.search.Query originalQuery, Map<String,String[]> efi) throws IOException - Specified by:
- createWeightin class- Feature
- Throws:
- IOException
 
 - 
validateprotected void validate() throws FeatureExceptionDescription copied from class:FeatureAs part of creation of a feature instance, this function confirms that the feature parameters are valid.- Specified by:
- validatein class- Feature
- Throws:
- FeatureException- Feature Exception
 
 
- 
 
-