tomglk commented on a change in pull request #123:
URL: https://github.com/apache/solr/pull/123#discussion_r632068196
##########
File path:
solr/contrib/ltr/src/java/org/apache/solr/ltr/feature/FieldValueFeature.java
##########
@@ -146,5 +171,100 @@ public float getMaxScore(int upTo) throws IOException {
return Float.POSITIVE_INFINITY;
}
}
+
+ /**
+ * A FeatureScorer that reads the docValues for a field
+ */
+ public class DocValuesFieldValueFeatureScorer extends
FeatureWeight.FeatureScorer {
+ final LeafReaderContext context;
+ final DocIdSetIterator docValues;
Review comment:
The restructuring happened in ec4cbfb.
I am not quite sure, whether I like the duplication in lines 216 & 219, but
by reversing the check for the type and the check for the presence of the
docId, the cast to the correct docValuesType can happen earlier, allowing the
use of `advanceExact()`.
`advanceExact()` generally seems to be preferred over `advance()`, can you
tell me why?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]