serhiy-bzhezytskyy commented on code in PR #4754:
URL: https://github.com/apache/solr/pull/4754#discussion_r3827900271


##########
solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java:
##########
@@ -455,13 +458,16 @@ public DocListAndSet getMoreLikeThis(
         rawMLTQuery = mlt.like(multifieldDoc);
       }
       boostedMLTQuery = getBoostedQuery(rawMLTQuery);
-      DocListAndSet results = new DocListAndSet();
-      if (this.needDocSet) {
-        results = searcher.getDocListAndSet(boostedMLTQuery, filters, null, 
start, rows, flags);
-      } else {
-        results.docList = searcher.getDocList(boostedMLTQuery, filters, null, 
start, rows, flags);
-      }
-      return results;
+      // setNeedDocSet must follow setFlags: it sets or clears GET_DOCSET 
within the flags

Review Comment:
   Same pattern:
   - `ResponseBuilder.createQueryCommand()`: 
`.setFlags(getFieldFlags()).setNeedDocSet(isNeedDocSet())`
   - `MoreLikeThisHandler.getMoreLikeThis(boosted query)`: 
`.setFlags(flags).setNeedDocSet(this.needDocSet)`
   
   Doesn't occur anywhere else.



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

Reply via email to