mirror of https://github.com/apache/lucene.git
Push @response down into Request::Standard, because not all Ruby responses have a response key
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@498439 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
18e95b18a7
commit
189ffc877c
|
@ -27,10 +27,8 @@ module Solr
|
|||
# but favor Ruby responses.
|
||||
@data = eval(ruby_code)
|
||||
@header = @data['responseHeader']
|
||||
@response = @data['response']
|
||||
raise "response should be a hash" unless @data.kind_of? Hash
|
||||
raise "response header missing" unless @header.kind_of? Hash
|
||||
raise "response section missing" unless @response.kind_of? Hash
|
||||
rescue Exception => e
|
||||
raise Solr::Exception.new("invalid ruby code: #{e}")
|
||||
end
|
||||
|
|
|
@ -17,6 +17,8 @@ module Solr
|
|||
|
||||
def initialize(ruby_code)
|
||||
super(ruby_code)
|
||||
@response = @data['response']
|
||||
raise "response section missing" unless @response.kind_of? Hash
|
||||
end
|
||||
|
||||
def total_hits
|
||||
|
|
Loading…
Reference in New Issue