You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by mk...@apache.org on 2022/11/25 17:47:35 UTC

[solr] branch main updated: SOLR-16420: fix QueryEqualityTest for {!mlt_content} (#1191)

This is an automated email from the ASF dual-hosted git repository.

mkhl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 9245cc2750f SOLR-16420: fix QueryEqualityTest for {!mlt_content} (#1191)
9245cc2750f is described below

commit 9245cc2750f87b255f9389755dcfd80d0f2220e8
Author: Mikhail Khludnev <mk...@users.noreply.github.com>
AuthorDate: Fri Nov 25 20:47:30 2022 +0300

    SOLR-16420: fix QueryEqualityTest for {!mlt_content} (#1191)
---
 .../test/org/apache/solr/search/QueryEqualityTest.java  | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
index c38d5f45094..5befc997361 100644
--- a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
+++ b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
@@ -1295,13 +1295,24 @@ public class QueryEqualityTest extends SolrTestCaseJ4 {
   }
 
   public void testQueryMLTContent() throws Exception {
-    assertU(adoc("id", "1", "lowerfilt", "sample data"));
+    assertU(adoc("id", "1", "lowerfilt", "sample data", "upperfilt", "SAMPLE DATA"));
     assertU(commit());
     try {
       assertQueryEquals(
-          "mlt",
+          "mlt_content",
           "{!mlt_content qf=lowerfilt}sample data",
-          "{!mlt_content qf=lowerfilt v='sample data'}");
+          "{!mlt_content qf=lowerfilt v='sample data'}",
+          "{!qf=lowerfilt}sample data");
+      SolrQueryRequest req = req(new String[] {"df", "text"});
+      try {
+        QueryUtils.checkUnequal(
+            QParser.getParser("{!mlt_content qf=lowerfilt}sample data", req).getQuery(),
+            QParser.getParser("{!mlt_content qf=lowerfilt qf=upperfilt}sample data", req)
+                .getQuery());
+      } finally {
+        req.close();
+      }
+
     } finally {
       delQ("*:*");
       assertU(commit());