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


##########
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:
   `setFlags` ORs bits in; `setNeedDocSet` OR's/AND-NOTs the `GET_DOCSET` bit 
in that same field. Order only matters for the `false` case — clearing, then a 
later `setFlags` whose value includes that bit, would undo the clear. Here 
`flags` only ever carries `GET_SCORES`, so it can't actually collide.



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