Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-6066

CollapsingQParserPlugin + Elevation does not respects "fq" (filter query)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.8
    • Fix Version/s: 4.9
    • Component/s: query parsers
    • Labels:
      None

      Description

      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)

          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']");
      

        Attachments

        1. SOLR-6066.patch
          12 kB
          David Boychuck
        2. SOLR-6066.patch
          5 kB
          David Boychuck
        3. SOLR-6066.patch
          11 kB
          David Boychuck
        4. TestCollapseQParserPlugin.java
          15 kB
          Herb Jiang

          Issue Links

            Activity

              People

              • Assignee:
                jbernste Joel Bernstein
                Reporter:
                herb Herb Jiang
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: