From 9245cc2750f87b255f9389755dcfd80d0f2220e8 Mon Sep 17 00:00:00 2001 From: Mikhail Khludnev Date: Fri, 25 Nov 2022 20:47:30 +0300 Subject: [PATCH] SOLR-16420: fix QueryEqualityTest for {!mlt_content} (#1191) --- .../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 void testQueryMLT() throws Exception { } 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());