Class: Solr::Indexing::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/indexing/request.rb

Constant Summary collapse

PATH =
'/update'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(documents = []) ⇒ Request

Returns a new instance of Request.



8
9
10
# File 'lib/solr/indexing/request.rb', line 8

def initialize(documents = [])
  @documents = documents
end

Instance Attribute Details

#documentsObject (readonly)

Returns the value of attribute documents.



6
7
8
# File 'lib/solr/indexing/request.rb', line 6

def documents
  @documents
end

Instance Method Details

#run(commit: false, runner_options: nil) ⇒ Object



12
13
14
15
16
# File 'lib/solr/indexing/request.rb', line 12

def run(commit: false, runner_options: nil)
  http_request = build_http_request(commit)
  options = default_runner_options.merge(runner_options || {})
  Solr::Request::Runner.call(request: http_request, **options)
end