dsmiley commented on code in PR #5394:
URL: https://github.com/apache/solr/pull/5394#discussion_r4723208753


##########
solr/core/src/test/org/apache/solr/schema/TestOmitPositions.java:
##########
@@ -54,20 +54,52 @@ public void testFrequencies() {
         "//result/doc[2]/str[@name='id'][.=1]");
   }
 
-  @SuppressWarnings("try")
-  public void testPositions() {
-    // no results should be found:
-    // lucene 3.x: silent failure
-    // lucene 4.x: illegal state exception, field was indexed without positions
+  /**
+   * An explicit phrase against a field indexed without positions is a 
client/schema mismatch, not a
+   * server fault: it must be rejected with 400.
+   */
+  public void testExplicitPhraseIsBadRequest() {
+    assertQEx(
+        "lucene parser: explicit phrase on omitPositions field",
+        req("fl", "id", "q", "nopositionstext:\"test test\""),
+        SolrException.ErrorCode.BAD_REQUEST);
+    assertQEx(
+        "edismax: explicit phrase via qf on omitPositions field",
+        req("fl", "id", "defType", "edismax", "qf", "nopositionstext", "q", 
"\"test test\""),
+        SolrException.ErrorCode.BAD_REQUEST);
+  }
 
-    try (ErrorLogMuter ignored = ErrorLogMuter.regex("was indexed without 
position data")) {
+  /**
+   * pf/pf2/pf3 are implicit, best-effort boosts the user never typed. A 
phrase field that cannot

Review Comment:
   This seems questionable.  A search developer listed fields here.  Shouldn't 
they know that one of the fields isn't working?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to