The search response should be cached only when it is not a partial error
or if it is so, only for range errors we should cache the result. This
is a hacky fix which caches the result when the above condition is
satisfied.
Partly addresses #6311 (does not fix the root cause where is_partial is
false even when there is function error).
---------
Co-authored-by: oasisk <ashish.j.kolhe@gmail.com>