dsmiley commented on code in PR #3340: URL: https://github.com/apache/solr/pull/3340#discussion_r2075758077
########## solr/core/src/test/org/apache/solr/search/function/ScoreFunctionDistribTest.java: ########## @@ -0,0 +1,188 @@ +package org.apache.solr.search.function; + +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.apache.solr.client.solrj.SolrClient; +import org.apache.solr.client.solrj.request.CollectionAdminRequest; +import org.apache.solr.client.solrj.request.UpdateRequest; +import org.apache.solr.cloud.SolrCloudTestCase; +import org.apache.solr.common.SolrException; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ScoreFunctionDistribTest extends SolrCloudTestCase { + + private static final String COLLECTION = "coll1"; + + private static SolrClient client; Review Comment: don't store a static field with a SolrClient; anyone can call cluster.getSolrClient if needed ########## solr/core/src/test/org/apache/solr/search/function/ScoreFunctionDistribTest.java: ########## Review Comment: I love this test -- using multi-line strings and assertJSONequals! (ugh that capitalization choice is terrible though; for another PR) ########## solr/core/src/java/org/apache/solr/search/SolrReturnFields.java: ########## @@ -547,6 +547,12 @@ private void addField( String disp = (key == null) ? field : key; augmenters.addTransformer(new MatchScoreAugmenter(disp)); scoreDependentFields.put(disp, disp.equals(MATCH_SCORE) ? "" : MATCH_SCORE); + } else if (key != null && isPseudoField) { + // SOLR-15030: a pseudo-field based on the function query may need scores, + // so we consider all pseudo-fields as potentially requiring scores. + // At the same time, we don't set _wantScore = true because the field + // list must explicitly include 'score' field to enable scores Review Comment: I'm confused or challenge what you say in this sentence. A DocTransformer could want the score. Granted, a DocTransformer doesn't have a `wantsScore` / `needsScore` so... :-/ -- 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