Class: Solr::DataImport::Request
- Inherits:
-
Object
- Object
- Solr::DataImport::Request
- Defined in:
- lib/solr/data_import/request.rb
Constant Summary collapse
- PATH =
'/dataimport'.freeze
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params) ⇒ Request
constructor
A new instance of Request.
-
#run(runner_options: nil) ⇒ Object
We want to make sure we send every dataimport request to the same node because this same class could be used to start a dataimport and to get dataimport progress data afterwards.
Constructor Details
#initialize(params) ⇒ Request
Returns a new instance of Request.
8 9 10 |
# File 'lib/solr/data_import/request.rb', line 8 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/solr/data_import/request.rb', line 6 def params @params end |
Instance Method Details
#run(runner_options: nil) ⇒ Object
We want to make sure we send every dataimport request to the same node because this same class could be used to start a dataimport and to get dataimport progress data afterwards. To make it consistent we will send dataimport requests only to the first shard leader replica
15 16 17 18 19 |
# File 'lib/solr/data_import/request.rb', line 15 def run(runner_options: nil) http_request = Solr::Request::HttpRequest.new(path: PATH, url_params: params, method: :get) = .merge( || {}) Solr::Request::Runner.call(request: http_request, **) end |