Module: SimpleSolrClient::Core::Admin

Included in:
SimpleSolrClient::Core
Defined in:
lib/simple_solr_client/core/admin.rb

Instance Method Summary collapse

Instance Method Details

#commitObject

Send a commit command

Returns:

  • self



5
6
7
8
# File 'lib/simple_solr_client/core/admin.rb', line 5

def commit
  update({'commit' => {}})
  self
end

#optimizeObject

Send an optimize command

Returns:

  • self



12
13
14
15
# File 'lib/simple_solr_client/core/admin.rb', line 12

def optimize
  update({"optimize" => {}})
  self
end

#reloadObject

Reload the core (for when you’ve changed the schema, solrconfig, synonyms, etc.) Make sure to mark the schema as dirty!

Returns:

  • self



20
21
22
23
# File 'lib/simple_solr_client/core/admin.rb', line 20

def reload
  get('admin/cores', {:force_top_level_url => true, :core => core, :action => 'RELOAD'})
  self
end

#unloadObject

Unload the current core and delete all its files

Returns:

  • The Solr response



27
28
29
# File 'lib/simple_solr_client/core/admin.rb', line 27

def unload
  get('admin/cores', {:force_top_level_url => true, :core => core, :action => 'UNLOAD', :deleteInstanceDir => true})
end