Skip to content

A quick implementation test of the Solr Group selecting feature - #6000

Draft
christinach wants to merge 3 commits into
mainfrom
group-selecting
Draft

A quick implementation test of the Solr Group selecting feature#6000
christinach wants to merge 3 commits into
mainfrom
group-selecting

Conversation

@christinach

Copy link
Copy Markdown
Member

This is a quick proof of concept for Solr's result grouping feature. Assuming the XML marc files are preprocessed and each cluster is assigned a unique cluster_id - in our case, a uuid- we can group on cluster_id and configure SOLR to return 'grouped' results.

Blacklight supports rendering grouped results and includes a view component that I didn't test. We can customize this work using Blacklight's configuration settings, or not.

The grouped search results are generated in SOLR . There is no primary cluster record indexed with merged metadata. If we decide to index a primary cluster record, we can revisit this approach and evaluate it in that context.

Next steps:
We could aggregate the holdings of each cluster into the record with the highest score and retain only that record in the cluster (primary record).

We're still evaluating the different approaches for implementing deduplication.

`http://localhost:62987/solr/bibdata-core-development/select?fl=title_display,holdings_1display,cluster_id,&group=true&group.field=cluster_id&rows=1000&group.limit=-1&sort=score%20desc&group.sort=score%20desc`

    - rows is set to 1000 so that it lists all the groups. we know that are less than 1000
    - group needs to be set to true so that it groups the results
    - group.field is cluster_id
    - group.limit is set to -1 so that we get all documents per group
    - sort is score desc so that we sort groups by relevance score first
    - group.sort is score desc so that the documents within each group are sorted by relevance score with highest first

related to pulibrary/bibdata#3382
related to pulibrary/dacs_handbook#321
related to pulibrary/pul_solr#555

christinach and others added 3 commits June 30, 2026 15:45
http://localhost:3000/catalog?fl=title_display%2Choldings_1display&group[field]=cluster_id&search_field=all_fields&q=cluster_id%3Aa50a7e39-e162-4300-ba48-9dd1f6a80283

related to pulibrary/bibdata#3382
related to pulibrary/dacs_handbook#321
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>
…iew it in the response

Update view to render the grouped results

Update result grouping method to return in the search results response the
grouped documents so that we can view the clusters

related to pulibrary/bibdata#3382
related to pulibrary/dacs_handbook#321

example:
`http://localhost:62987/solr/bibdata-core-development/select?fl=title_display,holdings_1display,cluster_id,&group=true&group.field=cluster_id&rows=1000&group.limit=-1&sort=score%20desc&group.sort=score%20desc`

- rows is set to 1000 so that it lists all the groups. we know that are less than 1000
- group needs to be set to true so that it groups the results
- group.field is cluster_id
- group.limit is set to -1 so that we get all documents per group
- sort is score desc so that we sort groups by relevance score first
- group.sort is score desc so that the documents within each group are sorted by relevance score with highest first
@christinach
christinach marked this pull request as draft July 2, 2026 17:58
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

Successfully merging this pull request may close these issues.

1 participant