Module: SimpleSolrClient::Core::CoreData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_solr_hashObject (readonly)

Returns the value of attribute raw_solr_hash.



2
3
4
# File 'lib/simple_solr_client/core/core_data.rb', line 2

def raw_solr_hash
  @raw_solr_hash
end

Instance Method Details

#config_fileObject



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

def config_file
  File.join(instance_dir, 'conf', core_data_hash['config'])
end

#core_data_hashObject

Get the core data for this core This is weird in that while the data is about a specific core, we need to call it at the client_url level; hence all the screwing around with force_top_level_url

It would make sense to cache this until, say, a commit or a reload, but the added complexity isn’t yet worth it.



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

def core_data_hash
  cdata = get('admin/cores', {:force_top_level_url => true})
  cdata['status'][core]
end

#data_dirObject



33
34
35
# File 'lib/simple_solr_client/core/core_data.rb', line 33

def data_dir
  core_data_hash['dataDir']
end

#default?Boolean

Returns:

  • (Boolean)


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

def default?
  core_data_hash['isDefaultCore']
end

#indexObject



17
18
19
# File 'lib/simple_solr_client/core/core_data.rb', line 17

def index
  core_data_hash['index']
end

#instance_dirObject



37
38
39
# File 'lib/simple_solr_client/core/core_data.rb', line 37

def instance_dir
  core_data_hash['instanceDir']
end

#last_modifiedObject



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

def last_modified
  Time.parse index['lastModified']
end

#number_of_documentsObject



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

def number_of_documents
  index['numDocs']
end

#schema_fileObject



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

def schema_file
  File.join(instance_dir, 'conf', core_data_hash['schema'])
end