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 classFeatureLogger.FeatureFormat
-
Field Summary
Fields Modifier and Type Field Description protected FeatureLogger.FeatureFormatfeatureFormatprotected BooleanlogAll
-
Constructor Summary
Constructors Modifier Constructor Description protectedFeatureLogger(String fvCacheName, FeatureLogger.FeatureFormat f, Boolean logAll)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetFeatureVector(int docid, LTRScoringQuery scoringQuery, SolrIndexSearcher searcher)populate the document with its feature vectorBooleanisLoggingAll()booleanlog(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 StringmakeFeatureVector(LTRScoringQuery.FeatureInfo[] featuresInfo)voidsetLogAll(Boolean logAll)
-
-
-
Field Detail
-
featureFormat
protected final FeatureLogger.FeatureFormat featureFormat
-
logAll
protected Boolean logAll
-
-
Constructor Detail
-
FeatureLogger
protected FeatureLogger(String fvCacheName, FeatureLogger.FeatureFormat f, Boolean logAll)
-
-
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.FeatureInfoobjects 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
-
isLoggingAll
public Boolean isLoggingAll()
-
setLogAll
public void setLogAll(Boolean logAll)
-
-