Class: SimpleSolrClient::Core

Inherits:
Client
  • Object
show all
Includes:
Admin, CoreData, Index, Search
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

Attributes included from CoreData

#raw_solr_hash

Attributes inherited from Client

#base_url, #rawclient

Instance Method Summary collapse

Methods included from Search

#all, #fv_search, #id

Methods included from Index

#add_docs, #clear, #delete

Methods included from CoreData

#config_file, #core_data_hash, #data_dir, #default?, #index, #instance_dir, #last_modified, #number_of_documents, #schema_file

Methods included from Admin

#commit, #optimize, #ping, #reload, #unload, #up?

Methods inherited from Client

#_get, #_post_json, #cores, #get, #new_core, #post_json, #raw_get_content, #temp_core, #temp_core_dir_setup, #top_level_url, #unload_temp_cores

Constructor Details

#initialize(url, core) ⇒ Core

Returns a new instance of Core.



28
29
30
31
# File 'lib/simple_solr_client/core.rb', line 28

def initialize(url, core)
  super(url)
  @core = core
end

Instance Attribute Details

#coreObject (readonly) Also known as: name

Returns the value of attribute core.



25
26
27
# File 'lib/simple_solr_client/core.rb', line 25

def core
  @core
end

Instance Method Details

#schemaObject



44
45
46
# File 'lib/simple_solr_client/core.rb', line 44

def schema
  @schema ||= SimpleSolrClient::Schema.new(self)
end

#update(object_to_post, response_type = nil) ⇒ Object

Send JSON to this core’s update/json handler



40
41
42
# File 'lib/simple_solr_client/core.rb', line 40

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



35
36
37
# File 'lib/simple_solr_client/core.rb', line 35

def url(*args)
  [@base_url, @core, *args].join('/').chomp('/')
end