aruggero commented on code in PR #3433:
URL: https://github.com/apache/solr/pull/3433#discussion_r2236241658
##########
solr/modules/ltr/src/java/org/apache/solr/ltr/LTRScoringQuery.java:
##########
@@ -551,16 +554,117 @@ public DocIdSetIterator iterator() {
return featureTraversalScorer.iterator();
}
- private class SparseModelScorer extends Scorer {
- private final DisiPriorityQueue subScorers;
- private final ScoringQuerySparseIterator itr;
+ public void setIsLogging(boolean isLogging) {
+ this.isLogging = isLogging;
+ }
- private int targetDoc = -1;
- private int activeDoc = -1;
+ abstract class FeatureTraversalScorer extends Scorer {
+ protected int targetDoc = -1;
+ protected int activeDoc = -1;
+ protected LeafReaderContext leafContext;
- private SparseModelScorer(
- Weight weight, List<Feature.FeatureWeight.FeatureScorer>
featureScorers) {
+ protected FeatureTraversalScorer(Weight weight, LeafReaderContext
leafContext) {
super(weight);
+ this.leafContext = leafContext;
+ }
+
+ @Override
+ public float score() throws IOException {
+ reset();
+ fillFeaturesInfo();
+ return makeNormalizedFeaturesAndScore();
+ }
+
+ @Override
+ public float getMaxScore(int upTo) throws IOException {
+ return Float.POSITIVE_INFINITY;
+ }
+
+ private void fillFeaturesInfo() throws IOException {
Review Comment:
Also, it's better to discuss this together. By now, this method invokes the
already existing "extractFeatureVector()" method, which depends on the type of
scorer currently used (it can be sparse or dense, we don't know a priori).
It also uses some variables that are "model weight" variables (parent class).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]