cpoerschke commented on code in PR #1557:
URL: https://github.com/apache/solr/pull/1557#discussion_r1192199410


##########
solr/modules/ltr/src/java/org/apache/solr/ltr/feature/FieldValueFeature.java:
##########
@@ -166,18 +167,23 @@ public FeatureScorer scorer(LeafReaderContext context) 
throws IOException {
     public class FieldValueFeatureScorer extends FeatureScorer {
 
       LeafReaderContext context = null;
+      StoredFields storedFields = null;

Review Comment:
   Wondering if this could be private and/or final (even though `context` isn't 
currently)?
   ```suggestion
         private final StoredFields storedFields;
   ```



##########
solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java:
##########
@@ -384,16 +386,17 @@ private void estimateTermVectors(Map<String, Object> 
result) throws IOException
     for (LeafReaderContext leafReaderContext : reader.leaves()) {
       LeafReader leafReader = leafReaderContext.reader();
       Bits liveDocs = leafReader.getLiveDocs();
+      TermVectors termVectors = leafReader.termVectors();
       for (int docId = 0; docId < leafReader.maxDoc(); docId += samplingStep) {
         if (liveDocs != null && !liveDocs.get(docId)) {
           continue;
         }
-        Fields termVectors = leafReader.getTermVectors(docId);
-        if (termVectors == null) {
+        Fields vectors = termVectors.get(docId);
+        if (vectors == null) {

Review Comment:
   > Why change the variable name? "vectors" is becoming a more ambiguous word 
in recent times ("vector search")
   
   I guess it allows the `termVectors` name to be used above where it matches 
the type and retrieval method name.
   
   How about `fields` as the changed variable name instead of `vectors`?



##########
solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java:
##########
@@ -251,6 +252,7 @@ public void process(ResponseBuilder rb) throws IOException {
     SolrIndexSearcher searcher = rb.req.getSearcher();
 
     IndexReader reader = searcher.getIndexReader();
+    TermVectors tm = reader.termVectors();

Review Comment:
   > Please improve this variable name, such as use `termVectors`
   
   There's a `NamedList<Object> termVectors` above already. Maybe that one 
could be renamed to `nlTermVectors` or `termVectorsNl` or something and then 
the `tm` here could become `termVectors`?



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to