Skip to content

321 result clustering - #3382

Draft
christinach wants to merge 8 commits into
mainfrom
321-result-clustering
Draft

christinach wants to merge 8 commits into
mainfrom
321-result-clustering

Conversation

@christinach

@christinach christinach commented Jun 26, 2026

Copy link
Copy Markdown
Member

related to pulibrary/dacs_handbook#321

The following returns a grouped search result on the field cluster_id:

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

result_clustering_example.json

christinach and others added 6 commits June 30, 2026 13:13
be used when we run a query to create a cluster

related to pulibrary/dacs_handbook#321
so that we can read it from traject_config.rb
because ruby will pass a string and ruby does not know about
passing a rust slice of string in memory

update spec with an exisitng mmsid from the cluster json file

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>
The following returns a grouped search result on the field cluster_id:

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 force-pushed the 321-result-clustering branch from fad77c5 to 218b5de Compare June 30, 2026 17:16
provide a random cluster_id uuid

we should make sure there is no collision between the uuids generation
christinach added a commit to pulibrary/pul_solr that referenced this pull request Jul 1, 2026
christinach added a commit to pulibrary/orangelight that referenced this pull request Jul 2, 2026
…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
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