Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Harden TestExtendedDismaxParser.testBf

Chris Hostettera12cf2f6d84e
diff --git a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
index 72546cc22c9..1f0b5690b90 100644
--- a/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
@@ -537,12 +537,13 @@ public class TestExtendedDismaxParser extends SolrTestCaseJ4 {
"//doc[3]/str[@name='id'][.='54']");
// adding value from a field
- // 0 would be returned for negative values
+ // 0 would be returned for negative values or docs w/o a value
assertQ(req("q", "*:*", "qf", "text_sw", "defType", "edismax",
- "bf", "foo_i", "fq", "id:[47 TO 49]", "fl", "id,score"),
- "//doc[1]/str[@name='id'][.='48']",
- "//doc[2]/str[@name='id'][.='47']",
- "//doc[3]/str[@name='id'][.='49']");
+ "bf", "foo_i", "fq", "id:[47 TO 49]", "fl", "id,score"),
+ "//doc[1]/str[@name='id'][.='48']",
+ // these should have identical score, in non-deterministic order
+ "//doc[str[@name='id'][.='47'] and float[@name='score'][.='1.0']]",
+ "//doc[str[@name='id'][.='49'] and float[@name='score'][.='1.0']]");
}
@Test