Package org.apache.solr.ltr.feature
Class Feature.FeatureWeight
- java.lang.Object
- 
- org.apache.lucene.search.Weight
- 
- org.apache.solr.ltr.feature.Feature.FeatureWeight
 
 
- 
- All Implemented Interfaces:
- org.apache.lucene.search.SegmentCacheable
 - Direct Known Subclasses:
- FieldLengthFeature.FieldLengthFeatureWeight,- FieldValueFeature.FieldValueFeatureWeight,- OriginalScoreFeature.OriginalScoreWeight,- SolrFeature.SolrFeatureWeight,- ValueFeature.ValueFeatureWeight
 - Enclosing class:
- Feature
 
 public abstract class Feature.FeatureWeight extends org.apache.lucene.search.WeightWeight for a feature
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classFeature.FeatureWeight.FeatureScorerA 'recipe' for computing a featureclassFeature.FeatureWeight.ValueFeatureScorerDefault FeatureScorer class that returns the score passed in.
 - 
Field SummaryFields Modifier and Type Field Description protected Map<String,String[]>efiprotected MacroExpandermacroExpanderprotected org.apache.lucene.search.QueryoriginalQueryprotected SolrQueryRequestrequestprotected org.apache.lucene.search.IndexSearchersearcher
 - 
Constructor SummaryConstructors Constructor Description FeatureWeight(org.apache.lucene.search.Query q, org.apache.lucene.search.IndexSearcher searcher, SolrQueryRequest request, org.apache.lucene.search.Query originalQuery, Map<String,String[]> efi)Initialize a feature without the normalizer from the feature file.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.lucene.search.Explanationexplain(org.apache.lucene.index.LeafReaderContext context, int doc)voidextractTerms(Set<org.apache.lucene.index.Term> terms)floatgetDefaultValue()intgetIndex()StringgetName()booleanisCacheable(org.apache.lucene.index.LeafReaderContext ctx)abstract Feature.FeatureWeight.FeatureScorerscorer(org.apache.lucene.index.LeafReaderContext context)StringtoString()Used in the FeatureWeight's explain.
 
- 
- 
- 
Field Detail- 
searcherprotected final org.apache.lucene.search.IndexSearcher searcher 
 - 
requestprotected final SolrQueryRequest request 
 - 
macroExpanderprotected final MacroExpander macroExpander 
 - 
originalQueryprotected final org.apache.lucene.search.Query originalQuery 
 
- 
 - 
Constructor Detail- 
FeatureWeightpublic FeatureWeight(org.apache.lucene.search.Query q, org.apache.lucene.search.IndexSearcher searcher, SolrQueryRequest request, org.apache.lucene.search.Query originalQuery, Map<String,String[]> efi)Initialize a feature without the normalizer from the feature file. This is called on initial construction since multiple models share the same features, but have different normalizers. A concrete model's feature is copied through featForNewModel().- Parameters:
- q- Solr query associated with this FeatureWeight
- searcher- Solr searcher available for features if they need them
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() 
 - 
getIndexpublic int getIndex() 
 - 
getDefaultValuepublic float getDefaultValue() 
 - 
scorerpublic abstract Feature.FeatureWeight.FeatureScorer scorer(org.apache.lucene.index.LeafReaderContext context) throws IOException - Specified by:
- scorerin class- org.apache.lucene.search.Weight
- Throws:
- IOException
 
 - 
isCacheablepublic boolean isCacheable(org.apache.lucene.index.LeafReaderContext ctx) 
 - 
explainpublic org.apache.lucene.search.Explanation explain(org.apache.lucene.index.LeafReaderContext context, int doc) throws IOException- Specified by:
- explainin class- org.apache.lucene.search.Weight
- Throws:
- IOException
 
 - 
toStringpublic String toString() Used in the FeatureWeight's explain. Each feature should implement this returning properties of the specific scorer useful for an explain. For example "MyCustomClassFeature [name=" + name + "myVariable:" + myVariable + "]"; If not provided, a default implementation will return basic feature properties, which might not include query time specific values.
 - 
extractTermspublic void extractTerms(Set<org.apache.lucene.index.Term> terms) - Specified by:
- extractTermsin class- org.apache.lucene.search.Weight
 
 
- 
 
-