Solr
  1. Solr
  2. SOLR-2246

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 3.1
    • Fix Version/s: 4.0-ALPHA
    • Component/s: Build
    • Labels:
      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.

        Issue Links

          Activity

          Bill Bell created issue -
          Bill Bell made changes -
          Field Original Value New Value
          Link This issue blocks SOLR-236 [ SOLR-236 ]
          Bill Bell made changes -
          Link This issue is blocked by SOLR-1682 [ SOLR-1682 ]
          Bill Bell made changes -
          Description Please add group.facet.after = true.

          The facet counts after grouping (field collapsing) are wrong.
          Please add group.facet.after = true option.

          After group.field=<field> we want the facets to be reduced by the grouping.

          Fix Version/s 4.0 [ 12314992 ]
          Fix Version/s 3.1 [ 12314371 ]
          Bill Bell made changes -
          Original Estimate 168h [ 604800 ]
          Remaining Estimate 168h [ 604800 ]
          Description Please add group.facet.after = true option.

          After group.field=<field> we want the facets to be reduced by the grouping.

          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.



          Bill Bell made changes -
          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.



          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.
          {code}
          <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>

          {code}

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

          Bill Bell made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Duplicate [ 3 ]
          Gavin made changes -
          Link This issue blocks SOLR-236 [ SOLR-236 ]
          Gavin made changes -
          Link This issue is depended upon by SOLR-236 [ SOLR-236 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Bill Bell
            • Votes:
              4 Vote for this issue
              Watchers:
              5 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

                  Development