[ https://issues.apache.org/jira/browse/SOLR-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129394#comment-14129394 ]
David Boychuck commented on SOLR-6066: -------------------------------------- I added the code from SOLR-6029 but the test provided fails because the nullPolicy documents are not grouped. I am not sure why {code} // 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']"); {code} {code} <response> <lst name="responseHeader"><int name="status">0</int><int name="QTime">5</int></lst><result name="response" numFound="3" start="0"><doc><float name="id">3.0</float><str name="term_s">YYYY</str><int name="test_ti">5000</int><long name="test_tl">100</long><float name="test_tf">200.0</float><long name="_version_">1478904610965946368</long></doc><doc><float name="id">4.0</float><str name="term_s">YYYY</str><int name="test_ti">500</int><long name="test_tl">1000</long><float name="test_tf">2000.0</float><long name="_version_">1478904610982723584</long></doc><doc><float name="id">6.0</float><str name="term_s">YYYY</str><str name="group_s">group2</str><int name="test_ti">10</int><long name="test_tl">100</long><float name="test_tf">200.0</float><long name="_version_">1478904610996355072</long></doc></result> </response> {code} > CollapsingQParserPlugin + Elevation does not respects "fq" (filter query) > -------------------------------------------------------------------------- > > Key: SOLR-6066 > URL: https://issues.apache.org/jira/browse/SOLR-6066 > Project: Solr > Issue Type: Bug > Components: query parsers > Affects Versions: 4.8 > Reporter: Herb Jiang > Assignee: Joel Bernstein > Fix For: 4.9 > > Attachments: SOLR-6066.patch, SOLR-6066.patch, SOLR-6066.patch, > TestCollapseQParserPlugin.java > > > QueryElevationComponent respects the "fq" parameter. But when use > CollapsingQParserPlugin with QueryElevationComponent, additional "fq" has no > effect. > I use following test case to show this issue. (It will failed) > {code:java} > String[] doc = {"id","1", "term_s", "YYYY", "group_s", "group1", > "category_s", "cat2", "test_ti", "5", "test_tl", "10", "test_tf", "2000"}; > assertU(adoc(doc)); > assertU(commit()); > String[] doc1 = {"id","2", "term_s","YYYY", "group_s", "group1", > "category_s", "cat2", "test_ti", "50", "test_tl", "100", "test_tf", "200"}; > assertU(adoc(doc1)); > String[] doc2 = {"id","3", "term_s", "YYYY", "test_ti", "5000", > "test_tl", "100", "test_tf", "200"}; > assertU(adoc(doc2)); > assertU(commit()); > String[] doc3 = {"id","4", "term_s", "YYYY", "test_ti", "500", "test_tl", > "1000", "test_tf", "2000"}; > assertU(adoc(doc3)); > String[] doc4 = {"id","5", "term_s", "YYYY", "group_s", "group2", > "category_s", "cat1", "test_ti", "4", "test_tl", "10", "test_tf", "2000"}; > assertU(adoc(doc4)); > assertU(commit()); > String[] doc5 = {"id","6", "term_s","YYYY", "group_s", "group2", > "category_s", "cat1", "test_ti", "10", "test_tl", "100", "test_tf", "200"}; > assertU(adoc(doc5)); > assertU(commit()); > //Test additional filter query when using collapse > params = new ModifiableSolrParams(); > params.add("q", "YYYY"); > params.add("fq", "{!collapse field=group_s}"); > params.add("fq", "category_s:cat1"); > params.add("defType", "edismax"); > params.add("bf", "field(test_ti)"); > params.add("qf", "term_s"); > params.add("qt", "/elevate"); > params.add("elevateIds", "2"); > assertQ(req(params), "*[count(//doc)=1]", > "//result/doc[1]/float[@name='id'][.='6.0']"); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org