public class FieldLengthFeature extends Feature
{ "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 also
ClassicSimilarity
)Modifier and Type | Class and Description |
---|---|
class |
FieldLengthFeature.FieldLengthFeatureWeight |
Feature.FeatureWeight
Constructor and Description |
---|
FieldLengthFeature(String name,
Map<String,Object> params) |
Modifier and Type | Method and Description |
---|---|
Feature.FeatureWeight |
createWeight(IndexSearcher searcher,
boolean needsScores,
SolrQueryRequest request,
Query originalQuery,
Map<String,String[]> efi) |
String |
getField() |
LinkedHashMap<String,Object> |
paramsToMap() |
void |
setField(String field) |
protected void |
validate()
As part of creation of a feature instance, this function confirms
that the feature parameters are valid.
|
equals, getDefaultValue, getIndex, getInstance, getName, hashCode, setDefaultValue, setIndex, toString
classHash, createWeight, rewrite, sameClassAs, toString
public String getField()
public void setField(String field)
public LinkedHashMap<String,Object> paramsToMap()
paramsToMap
in class Feature
protected void validate() throws FeatureException
Feature
validate
in class Feature
FeatureException
- Feature Exceptionpublic Feature.FeatureWeight createWeight(IndexSearcher searcher, boolean needsScores, SolrQueryRequest request, Query originalQuery, Map<String,String[]> efi) throws IOException
createWeight
in class Feature
IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.