Skip to content

Set the number of rows using the SearchBuilder#3870

Merged
jcoyne merged 1 commit into
mainfrom
set_rows_with_search_builder
Jun 17, 2026
Merged

Set the number of rows using the SearchBuilder#3870
jcoyne merged 1 commit into
mainfrom
set_rows_with_search_builder

Conversation

@jcoyne

@jcoyne jcoyne commented May 29, 2026

Copy link
Copy Markdown
Member

This enables us to switch to an alternative repository backend

Comment on lines +151 to +157
extra_controller_params.delete(:rows)
query = search_builder
.with(search_state)
.where(blacklight_config.document_model.unique_key => ids)
.merge(blacklight_config.fetch_many_document_params)
.merge(extra_controller_params)
query.rows(ids.count)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like it was possible to pass a rows value that was different than the length of the id array. How about retaining that for backwards compatibility?

Suggested change
extra_controller_params.delete(:rows)
query = search_builder
.with(search_state)
.where(blacklight_config.document_model.unique_key => ids)
.merge(blacklight_config.fetch_many_document_params)
.merge(extra_controller_params)
query.rows(ids.count)
requested_rows = extra_controller_params.delete(:rows)
query = search_builder
.with(search_state)
.where(blacklight_config.document_model.unique_key => ids)
.merge(blacklight_config.fetch_many_document_params)
.merge(extra_controller_params)
query.rows(requested_rows || ids.count)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was possible to do that, but is there a use case for that?

@jcoyne jcoyne force-pushed the set_rows_with_search_builder branch from 4c7460a to fc2279e Compare June 17, 2026 17:47
This enables us to switch to an alternative repository backend
@jcoyne jcoyne force-pushed the set_rows_with_search_builder branch from fc2279e to ccbb983 Compare June 17, 2026 17:50

@cjcolvar cjcolvar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good!

@jcoyne jcoyne merged commit 305b29f into main Jun 17, 2026
15 checks passed
@jcoyne jcoyne deleted the set_rows_with_search_builder branch June 17, 2026 21:15
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.

2 participants