alessandrobenedetti commented on a change in pull request #158:
URL: https://github.com/apache/solr/pull/158#discussion_r644026887
##########
File path:
solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
##########
@@ -1776,6 +1764,36 @@ private static String getParsedQuery(SolrQueryRequest
request) throws Exception
return (String) BaseTestHarness.evaluateXPath(resp,
"//str[@name='parsedquery']/text()", XPathConstants.STRING);
}
+ public void testSplitOnWhitespace_shouldRespectMinimumShouldMatch(){
+ String oner = "*[count(//doc)=1]";
+ String nor = "*[count(//doc)=0]";
+ /*
+ * in multi-field search with different analysis per field
+ * sow=true causes the minimum should match to be "per document"
+ * i.e a document to be a match must contain all the mm query terms
anywhere at least once
+ * sow=false causes the minimum should match to be "per field"
+ * i.e a document to be a match must contain all the mm query terms in
a single field at least once
+ * See https://issues.apache.org/jira/browse/SOLR-12779 for
additional details
+ */
+ assertQ(req("defType","edismax", "mm","100%", "q","Terminator: 100",
"qf","movies_t foo_i", "sow","true"),
+ nor); //no document contains both terms, in a field or in multiple
field
+
+ assertQ(req("defType","edismax", "mm","100%", "q","Terminator: 100",
"qf","movies_t foo_i", "sow","false"),
+ nor); //no document contains both terms in a field
+ assertQ(req("defType","edismax", "mm","100%", "q","Terminator: 100",
"qf","movies_t foo_i"), // default sow=false
Review comment:
done!
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]