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

Need group.facet.after = true to get facet counts after group by

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.1
    • 4.0-ALPHA
    • Build
    • None

    Description

      Please add group.facet.after = true option.

      The use case is that we want the facets numbers to count only the 1st item in each group if using the default limit of 1. This first item is what we show on the page,
      and facets needs to reflect what is shown on the page. The facet field should add the subsections when using "&group.facet.after=true"

      http://localhost:8983/solr/select?defType=dismax&q=Bill&facet=true&facet.field=gender&group=true&group.field=hgid&ident=true&fl=hgid,gender&sort=gender asc

      hgid:1
      gender:M

      hgid:1
      gender:F

      hgid:1
      gender:M

      – when grouping this returns 1 row, with gender:F.

      hgid:2
      gender:F

      hgid:2
      gender:M

      – when grouping this returns 1 row, with gender:F.

      hgid:3
      gender:M

      – when grouping this returns 1 row, with gender:M.

      <lst name="facet">
          <lst group="hgid">
            <lst name="facet_counts">
              <lst name="facet_queries"/>
              <lst name="facet_fields">
      			<lst name="gender">
      				<int name="M">1</int>
      				<int name="F">2</int>
      			</lst>
              </lst>
              <lst name="facet_dates"/>
              <lst name="facet_ranges"/>
            </lst>
          </lst>
      	<!-- could have other ones -->
      	<!-- this is the total counts -->
          <lst name="facet_counts">
              <lst name="facet_queries"/>
              <lst name="facet_fields">
      			<lst name="gender">
      				<int name="M">4</int>
      				<int name="F">2</int>
      			</lst>
              </lst>
              <lst name="facet_dates"/>
              <lst name="facet_ranges"/>
          </lst>
      </lst>
      
      

      After group.field=<field> we want the facet counts to reflect the documents that have been grouped.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              billnbell Bill Bell
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 168h
                  168h
                  Remaining:
                  Remaining Estimate - 168h
                  168h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified