I think this should be more descriptive of what params should not result in 500 being returned.
Just to clarify, when will URI result in an argument error?
When the URI is
> URI(nil) ArgumentError: bad argument (expected URI object or URI string)
If the search term includes only advanced filters, after all of these will be processed, the term becomes empty.
In that case, I think we should just add
return nil if uri.blank? to the top of this method so that we don’t have to do extra work when we already know that
uri is invalid.