cpoerschke commented on code in PR #2524:
URL: https://github.com/apache/solr/pull/2524#discussion_r1654776265


##########
solr/core/src/test/org/apache/solr/search/TestSearchPerf.java:
##########
@@ -173,7 +172,14 @@ private long doListGen(Query q, List<Query> filt) throws 
Exception {
     long ret = 0;
     for (int i = 0; i < ITERATIONS; i++) {
       DocList l =
-          searcher.getDocList(q, filt, (Sort) null, 0, 10, 
SolrIndexSearcher.NO_CHECK_QCACHE);
+          new QueryCommand()
+              .setQuery(q)
+              .setFilterList(filt)
+              .setOffset(0)

Review Comment:
   Hmm, I think the default is zero, no?
   
   
https://github.com/apache/solr/blob/releases/solr/9.6.1/solr/core/src/java/org/apache/solr/search/QueryCommand.java#L36



##########
solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java:
##########
@@ -161,13 +162,16 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
           mltDocs = mlt.getMoreLikeThis(reader, start, rows, filters, flags);
         } else if (q != null) {
           // Matching options

Review Comment:
   ```suggestion
   ```



##########
solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java:
##########
@@ -161,13 +162,16 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
           mltDocs = mlt.getMoreLikeThis(reader, start, rows, filters, flags);
         } else if (q != null) {
           // Matching options
-          boolean includeMatch = 
params.getBool(MoreLikeThisParams.MATCH_INCLUDE, true);
-          int matchOffset = params.getInt(MoreLikeThisParams.MATCH_OFFSET, 0);
-          // Find the base match
           DocList match =
-              searcher.getDocList(
-                  query, null, null, matchOffset, 1, flags); // only get the 
first one...
-          if (includeMatch) {
+              new QueryCommand()
+                  .setQuery(query)
+                  .setOffset(params.getInt(MoreLikeThisParams.MATCH_OFFSET, 0))
+                  .setLen(1) // only get the first one...
+                  .setFlags(flags)
+                  .search(searcher)
+                  .getDocList();
+          // Find the base match

Review Comment:
   ```suggestion
   ```



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