mirror of https://github.com/apache/lucene.git
SOLR-6029: CollapsingQParserPlugin throws ArrayIndexOutOfBoundsException if elevated doc has been deleted from a segment
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1590865 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5c2e9e8acf
commit
37e44ba41a
|
@ -266,7 +266,7 @@ public class CollapsingQParserPlugin extends QParserPlugin {
|
|||
if(termsEnum.seekExact(ref)) {
|
||||
docsEnum = termsEnum.docs(liveDocs, docsEnum);
|
||||
int doc = docsEnum.nextDoc();
|
||||
if(doc != -1) {
|
||||
if(doc != DocsEnum.NO_MORE_DOCS) {
|
||||
//Found the document.
|
||||
boostDocs.add(doc+docBase);
|
||||
it.remove();
|
||||
|
|
|
@ -343,6 +343,23 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
|
|||
params.add("group.field", "id");
|
||||
assertQ(req(params), "*[count(//doc)=2]");
|
||||
|
||||
|
||||
// delete the elevated docs, confirm collapsing still works
|
||||
assertU(delI("1"));
|
||||
assertU(delI("2"));
|
||||
assertU(commit());
|
||||
params = new ModifiableSolrParams();
|
||||
params.add("q", "YYYY");
|
||||
params.add("fq", "{!collapse field=group_s nullPolicy=collapse}");
|
||||
params.add("defType", "edismax");
|
||||
params.add("bf", "field(test_ti)");
|
||||
params.add("qf", "term_s");
|
||||
params.add("qt", "/elevate");
|
||||
assertQ(req(params), "*[count(//doc)=2]",
|
||||
"//result/doc[1]/float[@name='id'][.='3.0']",
|
||||
"//result/doc[2]/float[@name='id'][.='6.0']");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue