epugh commented on code in PR #4754:
URL: https://github.com/apache/solr/pull/4754#discussion_r3813603074
##########
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:
Ugh... wow, that sounds like a "foot gun"... is there anyway to prevent
someone from making this mistake? Or, is it so localized to just this class
that no one else will accidetnally do setNeedDocSet before setFlags?
Any ideas?
--
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]