Class: Solr::Query::Handler
- Inherits:
-
Object
- Object
- Solr::Query::Handler
- Defined in:
- lib/solr/query/handler.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#runner_options ⇒ Object
readonly
Returns the value of attribute runner_options.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(query:, rows:, start:, runner_options: {}) ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize(query:, rows:, start:, runner_options: {}) ⇒ Handler
Returns a new instance of Handler.
14 15 16 17 18 19 |
# File 'lib/solr/query/handler.rb', line 14 def initialize(query:, rows:, start:, runner_options: {}) @query = query @rows = rows @start = start @runner_options = || {} end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
8 9 10 |
# File 'lib/solr/query/handler.rb', line 8 def query @query end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
8 9 10 |
# File 'lib/solr/query/handler.rb', line 8 def rows @rows end |
#runner_options ⇒ Object (readonly)
Returns the value of attribute runner_options.
8 9 10 |
# File 'lib/solr/query/handler.rb', line 8 def @runner_options end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
8 9 10 |
# File 'lib/solr/query/handler.rb', line 8 def start @start end |
Class Method Details
.call(opts) ⇒ Object
10 11 12 |
# File 'lib/solr/query/handler.rb', line 10 def self.call(opts) new(**opts).call end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'lib/solr/query/handler.rb', line 21 def call http_request = Solr::Query::HttpRequestBuilder.call(query: query, start: start, rows: rows) solr_response = Solr::Request::Runner.call(request: http_request, **) Solr::Query::Response::Parser.new(request: query, solr_response: solr_response.body).to_response end |