Module: SimpleSolrClient::Core::CoreData
- Included in:
- SimpleSolrClient::Core
- Defined in:
- lib/simple_solr_client/core/core_data.rb
Instance Attribute Summary collapse
-
#raw_solr_hash ⇒ Object
readonly
Returns the value of attribute raw_solr_hash.
Instance Method Summary collapse
- #config_file ⇒ Object
-
#core_data_hash ⇒ Object
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.
- #data_dir ⇒ Object
- #default? ⇒ Boolean
- #index ⇒ Object
- #instance_dir ⇒ Object
- #last_modified ⇒ Object
- #number_of_documents ⇒ Object
- #schema_file ⇒ Object
Instance Attribute Details
#raw_solr_hash ⇒ Object (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_file ⇒ Object
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_hash ⇒ Object
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_dir ⇒ Object
33 34 35 |
# File 'lib/simple_solr_client/core/core_data.rb', line 33 def data_dir core_data_hash['dataDir'] end |
#default? ⇒ Boolean
21 22 23 |
# File 'lib/simple_solr_client/core/core_data.rb', line 21 def default? core_data_hash['isDefaultCore'] end |
#index ⇒ Object
17 18 19 |
# File 'lib/simple_solr_client/core/core_data.rb', line 17 def index core_data_hash['index'] end |
#instance_dir ⇒ Object
37 38 39 |
# File 'lib/simple_solr_client/core/core_data.rb', line 37 def instance_dir core_data_hash['instanceDir'] end |
#last_modified ⇒ Object
25 26 27 |
# File 'lib/simple_solr_client/core/core_data.rb', line 25 def last_modified Time.parse index['lastModified'] end |
#number_of_documents ⇒ Object
29 30 31 |
# File 'lib/simple_solr_client/core/core_data.rb', line 29 def number_of_documents index['numDocs'] end |
#schema_file ⇒ Object
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 |