dsmiley commented on code in PR #4754:
URL: https://github.com/apache/solr/pull/4754#discussion_r3826959887


##########
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:
   That complicated explanation only reinforces Eric's point IMO.  
   
   Perhaps there should be internal enforcement on setFlags needing to be 
called prior to setNeedDocSet (and possibly other methods as needed).  Or, even 
better IMO: some methods should be strictly either-or: if you call setFlags, 
then you then lose the right to call setters that set other bits on the same 
flags.



##########
changelog/unreleased/SOLR-18371-remove-prequerycommand-solrindexsearcher-methods.yml:
##########


Review Comment:
   no user will care to read the changelog on this one



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