mirror of https://github.com/apache/lucene.git
34 lines
553 B
Ruby
34 lines
553 B
Ruby
|
module Solr
|
||
|
module Response
|
||
|
class Standard < Solr::Response::Ruby
|
||
|
include Enumerable
|
||
|
|
||
|
def initialize(ruby_code)
|
||
|
super(ruby_code)
|
||
|
end
|
||
|
|
||
|
def total_hits
|
||
|
return @response['numFound']
|
||
|
end
|
||
|
|
||
|
def start
|
||
|
return @response['start']
|
||
|
end
|
||
|
|
||
|
def hits
|
||
|
return @response['docs']
|
||
|
end
|
||
|
|
||
|
def max_score
|
||
|
return @response['maxScore']
|
||
|
end
|
||
|
|
||
|
# supports enumeration of hits
|
||
|
def each
|
||
|
@response['docs'].each {|hit| yield hit}
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|