Package org.apache.solr.ltr.feature
Class FieldLengthFeature
- java.lang.Object
- 
- org.apache.lucene.search.Query
- 
- org.apache.solr.ltr.feature.Feature
- 
- org.apache.solr.ltr.feature.FieldLengthFeature
 
 
 
- 
 public class FieldLengthFeature extends Feature This feature returns the length of a field (in terms) for the current document. Example configuration:{ "name": "titleLength", "class": "org.apache.solr.ltr.feature.FieldLengthFeature", "params": { "field": "title" } }Note: since this feature relies on norms values that are stored in a single byte the value of the feature could have a lightly different value. (see alsoClassicSimilarity)
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classFieldLengthFeature.FieldLengthFeatureWeight- 
Nested classes/interfaces inherited from class org.apache.solr.ltr.feature.FeatureFeature.FeatureWeight
 
- 
 - 
Constructor SummaryConstructors Constructor Description FieldLengthFeature(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)StringgetField()LinkedHashMap<String,Object>paramsToMap()voidsetField(String field)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- 
getFieldpublic String getField() 
 - 
setFieldpublic void setField(String field) 
 - 
paramsToMappublic LinkedHashMap<String,Object> paramsToMap() - Specified by:
- paramsToMapin class- Feature
 
 - 
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
 
 - 
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
 
 
- 
 
-