lib/thinking_sphinx/search.rb in friendlyfashion-thinking-sphinx-2.0.13.2 vs lib/thinking_sphinx/search.rb in friendlyfashion-thinking-sphinx-2.0.13.3

- old
+ new

@@ -422,27 +422,27 @@ @populated = true retries = hard_retries begin retry_on_stale_index do - begin - retry_on_index_not_preread do + retry_on_index_not_preread do + begin log query do @results = client.query query, indexes, comment end - end - total = @results[:total_found].to_i - log "Found #{total} result#{'s' unless total == 1}" + total = @results[:total_found].to_i + log "Found #{total} result#{'s' unless total == 1}" - log "Sphinx Daemon returned warning: #{warning}" if warning? + log "Sphinx Daemon returned warning: #{warning}" if warning? - if error? - log "Sphinx Daemon returned error: #{error}" - raise SphinxError.new(error, @results) unless options[:ignore_errors] + if error? + log "Sphinx Daemon returned error: #{error}" + raise SphinxError.new(error, @results) unless options[:ignore_errors] + end + rescue Errno::ECONNREFUSED => err + raise ThinkingSphinx::ConnectionError, + 'Connection to Sphinx Daemon (searchd) failed.' end - rescue Errno::ECONNREFUSED => err - raise ThinkingSphinx::ConnectionError, - 'Connection to Sphinx Daemon (searchd) failed.' end compose_results end rescue => e