Use case/when instead of chain of if
Extract SearchRequest#complex_output?
Introduce SearchRequest#output method
Use @request.output
Use @request.complex_output?