Class: Solr::Request::Commit

Inherits:
Update show all
Defined in:
lib/solr/request/commit.rb

Instance Method Summary collapse

Methods inherited from Update

#handler, #response_format

Methods inherited from Base

#content_type, #handler, #response_format

Constructor Details

#initialize(options = {}) ⇒ Commit

Returns a new instance of Commit.



17
18
19
20
# File 'lib/solr/request/commit.rb', line 17

def initialize(options={})
  @wait_searcher = options[:wait_searcher] || true
  @wait_flush = options[:wait_flush] || true
end

Instance Method Details

#to_sObject



23
24
25
26
27
28
29
# File 'lib/solr/request/commit.rb', line 23

def to_s
  e = Solr::XML::Element.new('commit')
  e.attributes['waitSearcher'] = @wait_searcher ? 'true' : 'false'
  e.attributes['waitFlush'] = @wait_flush ? 'true' : 'false'
  
  e.to_s
end