risdenk commented on code in PR #2221:
URL: https://github.com/apache/solr/pull/2221#discussion_r1471252293


##########
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java:
##########
@@ -169,6 +160,20 @@ public void prepare(ResponseBuilder rb) throws IOException 
{
 
     try {
       QParser parser = QParser.getParser(rb.getQueryString(), defType, req);
+
+      SortSpec sortSpec = parser.getSortSpec(true);
+      rb.setSortSpec(sortSpec);
+      boolean someDocs = sortSpec == null || sortSpec.getCount() != 0;
+
+      // Set field flags

Review Comment:
   `sortSpec.getCount()` is the rows for the query. SortSpec encapsulates the 
pulling out of sort details and rows for the query. The parser fills in 
SortSpec so wanted to reuse that logic instead of explicitly trying to parse 
rows myself.
   
   I have a separate commit coming soon once tests pass to actually make 
SortSpec and SolrReturnFields a bit smarter about rows=0. 
   
   There is some weird intermingling of `GET_SCORES` where it only applies to 
the `fl` but not to the sort. So if `score` is in the `sort` (which it is by 
default) then you still calculate scores in a lot of cases.



-- 
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