Skip to content

Conversation

@jcoyne
Copy link
Member

@jcoyne jcoyne commented May 30, 2025

We already know which parameters we requested. This supports elasticsearch, which does not echo the request params

We already know which parameters we requested.  This supports elasticsearch, which does not echo the request params
def sort
search_builder&.sort || single_valued_param(:sort)
end
delegate :start, :rows, :sort, to: :search_builder
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this require search_builder to exist? I think it can still be nil. Should the initializer for B::S::Response create one if it's missing from the params (ie, if a hash or nil is passed as second arg)?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does require search_builder to exist. Can you explain which case it would not exist? The search builder is initialized in the initializer for Blacklight::Solr::Response.

Copy link
Contributor

Choose a reason for hiding this comment

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

The search_builder is only initialized if the request_params are a Blacklight::SearchBuilder. I didn't see another place where the search_builder is created in Blacklight::Solr::Response. https://github.com/projectblacklight/blacklight/blob/main/lib/blacklight/solr/response.rb#L19

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.

3 participants