You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/06/02 20:30:40 UTC

[GitHub] [solr] magibney commented on a change in pull request #129: SOLR-15407 untokenized field type with sow=false fix + tests

magibney commented on a change in pull request #129:
URL: https://github.com/apache/solr/pull/129#discussion_r644298892



##########
File path: solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
##########
@@ -1771,6 +1775,35 @@ public void testSplitOnWhitespace_Basic() throws Exception {
     assertThat(parsedquery, anyOf(containsString("((name:stigma | title:stigma))"), containsString("((title:stigma | name:stigma))")));
   }
 
+    @Test 
+    public void testQf_stringFieldWithSowFalse_shouldBuildSingleQueryClause() throws Exception
+    {
+        assertJQ(req("qf", "trait_ss", "defType", "edismax", "q", "multi term", "sow", "false"),
+            "/response/numFound==1", "/response/docs/[0]/id=='75'");
+
+        String parsedquery = getParsedQuery(
+            req("qf", "trait_ss", "q", "multi term", "defType", "edismax", "sow", "false", "debugQuery", "true"));
+        assertThat(parsedquery, anyOf(containsString("((trait_ss:multi term))")));
+    }
+
+    @Test
+    public void testQf_numericField_shouldBuildMultipleQueryClausesIndependentlyOfSow() throws Exception
+    {
+        assertJQ(req("qf", "foo_i", "defType", "edismax", "q", "101 102", "sow", "false"),
+            "/response/numFound==2", "/response/docs/[0]/id=='76'", "/response/docs/[1]/id=='77'");
+
+        String parsedquery = getParsedQuery(
+            req("qf", "foo_i", "q", "101 102", "defType", "edismax", "sow", "false", "debugQuery", "true"));
+        assertThat(parsedquery, anyOf(containsString("foo_i:[101 TO 101]"), containsString("foo_i:[102 TO 102]")));

Review comment:
       I think you may want `allOf(...)` here (and line 1804 below) instead of `anyOf(...)`




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

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