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 results pagination show incorrect number of results #1249

Open
starsplatter opened this issue Sep 22, 2015 · 7 comments
Open

grouped results pagination show incorrect number of results #1249

starsplatter opened this issue Sep 22, 2015 · 7 comments

Comments

@starsplatter
Copy link
Contributor

In my catalog controller, I have set up what it looked like I needed to do for result grouping (found mostly by trolling through old posts in the group since the wiki section on grouping is doesn't say much: https://github.com/projectblacklight/blacklight/wiki/Configuration---Results-View )

So here is what I have:

blacklight_config.default_solr_params = 
{ 
 :fq => 
:'group.main'=>'true',
  :group=>'true',
  :'group.field'=>'book_id_ts',
  :'group.format'=>'simple',
  :'group.limit' => 1

}

and

config.index.group = true
config.index.group_field = 'book_id_ts'

This set up returns grouped results but the pagination numbers reflect the ungrouped results. So if there are 17 actual documents but only 12 groups, there will be 12 results but the pagination will state there are 17.

@jkeck
Copy link
Contributor

jkeck commented Sep 23, 2015

I think this may be a duplicate of #890.

@cbeer
Copy link
Member

cbeer commented Sep 23, 2015

It's not clear to me how Blacklight can provide the "correct" behavior in this scenario. I think there's an open question whether Blacklight is counting documents or groups (because you could display multiple documents for each group, and provide access to the full list somehow..).

@starsplatter
Copy link
Contributor Author

I agree. It looks to me like blacklight is only seeing the document count and not the group count. My read of the wiki was that blacklight should somehow be able to figure this out by setting the "group" parameter, etc. but I think I was incorrect.

@jcoyne
Copy link
Member

jcoyne commented Sep 23, 2015

@starsplatter I think we can figure it out if you have group.format=grouped but you set group.format=simple. The format or the response returned by the simple format is so simple that we can't tell it's a grouped response.

@starsplatter
Copy link
Contributor Author

It does look like a duplicate of #890 I tried changing group.format to grouped but it doesn't affect the count. The only thing that seems to change the response to include the number of groups is to set :'group.ngroups'=>'true' as mentioned in 890. When I do that, I think I'm getting a response that is different than the structure blacklight might be expecting? The start of the grouped response looks like:

#<Blacklight::SolrResponse::GroupResponse:0x007fa6c2a8ae10 @key="book_id_ts", @group={"matches"=>17, "ngroups"=>12, "groups"=>[{"groupValue"=>"nur00567", "doclist"=>{"numFound"=>3, "start"=>0, "maxScore"=>2.0465183, "docs"=>

... list of docs in group, list of more groups...

@response= <Blacklight::SolrResponse::GroupResponse:0x007fa6c2a8ae10 ...>>]>

@jcoyne
Copy link
Member

jcoyne commented Sep 23, 2015

@starsplatter please gist the result from solr when you set group.format=grouped. It looks like we're getting closer.

@starsplatter
Copy link
Contributor Author

here it is with group.format=grouped and the ngroups also set to true https://gist.github.com/starsplatter/fe89be4fe1df6a3dc07b

@cbeer cbeer modified the milestone: 6.x Nov 17, 2015
@cbeer cbeer modified the milestones: 6.x, 7.x Sep 9, 2016
@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