Class: SimpleSolrClient::Core
- Defined in:
- lib/simple_solr_client/core.rb,
lib/simple_solr_client/core.rb
Defined Under Namespace
Modules: Admin, CoreData, Index, Search
Instance Attribute Summary collapse
-
#core ⇒ Object
(also: #name)
readonly
Returns the value of attribute core.
Attributes included from CoreData
Attributes inherited from Client
Instance Method Summary collapse
-
#initialize(url, core = nil) ⇒ Core
constructor
A new instance of Core.
-
#update(object_to_post, response_type = nil) ⇒ Object
Send JSON to this core’s update/json handler.
-
#url(*args) ⇒ Object
Override #url so we’re now talking to the core.
Methods included from Search
Methods included from Index
Methods included from CoreData
#config_file, #core_data_hash, #data_dir, #index, #instance_dir, #last_modified, #number_of_documents, #size
Methods included from Admin
#commit, #optimize, #reload, #unload
Methods inherited from Client
#_get, #_post_json, #cores, #get, #major_version, #new_core, #ping, #post_json, #raw_get_content, #system, #temp_core, #temp_core_dir_setup, #top_level_url, #unload_temp_cores, #up?, #version
Constructor Details
#initialize(url, core = nil) ⇒ Core
Returns a new instance of Core.
26 27 28 29 30 31 32 33 34 |
# File 'lib/simple_solr_client/core.rb', line 26 def initialize(url, core=nil) if core.nil? components = url.gsub(%r[/\Z], '').split('/') core = components.last url = components[0..-2].join('/') end super(url) @core = core end |
Instance Attribute Details
#core ⇒ Object (readonly) Also known as: name
Returns the value of attribute core.
23 24 25 |
# File 'lib/simple_solr_client/core.rb', line 23 def core @core end |
Instance Method Details
#update(object_to_post, response_type = nil) ⇒ Object
Send JSON to this core’s update/json handler
43 44 45 |
# File 'lib/simple_solr_client/core.rb', line 43 def update(object_to_post, response_type = nil) post_json('update/json', object_to_post, response_type) end |
#url(*args) ⇒ Object
Override #url so we’re now talking to the core
38 39 40 |
# File 'lib/simple_solr_client/core.rb', line 38 def url(*args) [@base_url, @core, *args].join('/').chomp('/') end |