Stop looking in the Solr response to determine the request params#3632
Stop looking in the Solr response to determine the request params#3632
Conversation
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 |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
We already know which parameters we requested. This supports elasticsearch, which does not echo the request params