Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouped result aren't shown or Paging is wrong #890

Open
trobby opened this issue Apr 28, 2014 · 3 comments
Open

Grouped result aren't shown or Paging is wrong #890

trobby opened this issue Apr 28, 2014 · 3 comments

Comments

@trobby
Copy link

trobby commented Apr 28, 2014

I can't get a grouping / field collapsing setup in blacklight, which works correctly.
Either I use (additionally to base setup of the grouping: :group => true, :'group.field' => 'source_id', :'group.ngroups' => true):

  • :group.format=simple: results are displayed, but the paging is wrong. The total amount (numFound) is used for creating the paging, not ngroups
  • if not: no results will be shown, but the paging is correct

I'm not shure if this is a bug, but it seems, that something is going wrong in the app/helpers/blacklight/blacklight_helper_behavior.rb whilst defining if the response is grouped or whilst using the ngroup instead of numFound (app/helpers/blacklight/catalog_helper_behavior.rb). I tried to figure it out on myself, but I'm quite new in blacklight, rails ...
I'm using Blacklight 5.2 with blacklight-jetty-4.6.0/.

@trobby trobby changed the title grouped result aren't shown Grouped result aren't shown or Paging is wrong Apr 28, 2014
@jkeck
Copy link
Contributor

jkeck commented Apr 28, 2014

I believe we need to change https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight/solr_response/group.rb#L18-L20 to be

  def total
    doclist[:ngroups].to_s.to_i
  end

as is the case in the code that was part of the inspiration for the integration into Blacklight ( https://github.com/sul-dlss/frda/blob/master/lib/frda/grouped_solr_response.rb#L31 ). There may be some other considerations around paginating grouped responses that we'll want to take a look at to make sure it works the same as the existing flat document list pagination.

@cbeer cbeer added this to the 5.5.0 milestone May 7, 2014
@cbeer cbeer modified the milestones: 5.x, 5.5.0 Jul 7, 2014
@cbeer cbeer modified the milestones: 5.x, 6.0.0 Oct 19, 2015
@cbeer cbeer modified the milestones: 6.0.0, 6.x Nov 8, 2015
@cbeer cbeer modified the milestones: 6.x, 7.x Sep 9, 2016
@JTatum95
Copy link

JTatum95 commented Jun 6, 2018

I don't think this is the solution. 'ngroups' returns the number of groups, not the total number of results. There is a field called 'matches' which should be the correct number of results equal to the sum of the number in each category (group). If you are looking for matches in each group, then it would 'numFound'.

@barmintor
Copy link
Contributor

Moving to 7.x, cf #1249

@barmintor barmintor modified the milestones: 7.0, 7.x Oct 23, 2018
@carolyncole carolyncole removed this from the 7.x milestone Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants