SOLR-8295: fix buggy test assumption

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1714843 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2015-11-17 18:18:05 +00:00
parent b5ed21b258
commit 95dbd95e62
1 changed files with 7 additions and 4 deletions

View File

@ -654,7 +654,7 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
"//result/doc[2]/float[@name='id'][.='1.0']");
// Test collapse using selector field in no docs
// tie selector in all of these cases, so index order applies
// tie selector in all of these cases
for (String selector : new String[] {
" min=bogus_ti ", " sort='bogus_ti asc' ",
" max=bogus_ti ", " sort='bogus_ti desc' ",
@ -666,11 +666,14 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group + selector + hint+"}");
params.add("sort", "id asc");
params.add("sort", group + " asc");
assertQ(req(params),
"*[count(//doc)=2]",
"//result/doc[1]/float[@name='id'][.='1.0']",
"//result/doc[2]/float[@name='id'][.='5.0']");
// since selector is bogus, group head is undefined
// (should be index order, but don't make absolute assumptions: segments may be re-ordered)
// key assertion is that there is one doc from each group & groups are in order
"//result/doc[1]/*[@name='"+group+"'][starts-with(.,'1')]",
"//result/doc[2]/*[@name='"+group+"'][starts-with(.,'2')]");
}
// attempting to use cscore() in sort local param should fail