You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "mkhludnev (via GitHub)" <gi...@apache.org> on 2023/02/19 13:41:54 UTC

[GitHub] [solr] mkhludnev commented on a diff in pull request #1260: SOLR-788: transfer mlt query for component right

mkhludnev commented on code in PR #1260:
URL: https://github.com/apache/solr/pull/1260#discussion_r1111239181


##########
solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java:
##########
@@ -422,6 +417,24 @@ public DocListAndSet getMoreLikeThis(
       return results;
     }
 
+    public List<InterestingTerm> getInterestingTerms(int docid) throws IOException {
+      final ArrayList<InterestingTerm> interestingTerms = new ArrayList<>();
+      getBoostedMLTQuery(docid, interestingTerms);
+      return interestingTerms;
+    }
+    /**
+     * Sets {@link #boostedMLTQuery} and return, also put interesting terms into terms list if
+     * provided non-null. Sorry. It lacks of perfection and overall sense.

Review Comment:
   Got it. This collection also let to bypass terms extraction. I'm not sure it allows to save a lot of computation, I prefer to keep it lazy. I tries to toss code a little to improve. The root cause of this ugliness is lack of proper public method in Lucene. It's worth to decouple terms extraction, field assignment and query factoring. It will let to boost clauses without boolean query ripping.     



-- 
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-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org