Package org.apache.solr.ltr
Class FeatureLogger
- java.lang.Object
-
- org.apache.solr.ltr.FeatureLogger
-
- Direct Known Subclasses:
CSVFeatureLogger
public abstract class FeatureLogger extends Object
FeatureLogger can be registered in a model and provide a strategy for logging the feature values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FeatureLogger.FeatureFormat
-
Field Summary
Fields Modifier and Type Field Description protected FeatureLogger.FeatureFormat
featureFormat
-
Constructor Summary
Constructors Modifier Constructor Description protected
FeatureLogger(String fvCacheName, FeatureLogger.FeatureFormat f)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getFeatureVector(int docid, LTRScoringQuery scoringQuery, SolrIndexSearcher searcher)
populate the document with its feature vectorboolean
log(int docid, LTRScoringQuery scoringQuery, SolrIndexSearcher searcher, LTRScoringQuery.FeatureInfo[] featuresInfo)
Log will be called every time that the model generates the feature values for a document and a query.abstract String
makeFeatureVector(LTRScoringQuery.FeatureInfo[] featuresInfo)
-
-
-
Field Detail
-
featureFormat
protected final FeatureLogger.FeatureFormat featureFormat
-
-
Constructor Detail
-
FeatureLogger
protected FeatureLogger(String fvCacheName, FeatureLogger.FeatureFormat f)
-
-
Method Detail
-
log
public boolean log(int docid, LTRScoringQuery scoringQuery, SolrIndexSearcher searcher, LTRScoringQuery.FeatureInfo[] featuresInfo)
Log will be called every time that the model generates the feature values for a document and a query.- Parameters:
docid
- Solr document id whose features we are savingfeaturesInfo
- List of all theLTRScoringQuery.FeatureInfo
objects which contain name and value for all the features triggered by the result set- Returns:
- true if the logger successfully logged the features, false otherwise.
-
makeFeatureVector
public abstract String makeFeatureVector(LTRScoringQuery.FeatureInfo[] featuresInfo)
-
getFeatureVector
public String getFeatureVector(int docid, LTRScoringQuery scoringQuery, SolrIndexSearcher searcher)
populate the document with its feature vector- Parameters:
docid
- Solr document id- Returns:
- String representation of the list of features calculated for docid
-
-