Class: SimpleSolrClient::Schema::FieldType
- Inherits:
-
Field_or_Type
- Object
- Field_or_Type
- SimpleSolrClient::Schema::FieldType
- Includes:
- Analysis
- Defined in:
- lib/simple_solr_client/schema/field_type.rb
Constant Summary
Constants inherited from Field_or_Type
SimpleSolrClient::Schema::Field_or_Type::BOOL_ATTR_MAP, SimpleSolrClient::Schema::Field_or_Type::TEXT_ATTR_MAP
Instance Attribute Summary collapse
-
#core ⇒ Object
Returns the value of attribute core.
-
#solr_class ⇒ Object
Returns the value of attribute solr_class.
-
#xml ⇒ Object
Returns the value of attribute xml.
Attributes inherited from Field_or_Type
Class Method Summary collapse
- .new_from_solr_hash(h) ⇒ Object
-
.new_from_xml(xml) ⇒ Object
Luckily, a nokogiri node can act like a hash, so we can just re-use #new_from_solr_hash.
Instance Method Summary collapse
-
#initialize(*args) ⇒ FieldType
constructor
A new instance of FieldType.
-
#type ⇒ Object
Make sure the type is never set, so we don’t get stuck trying to find a type’s “type”.
Methods included from Analysis
#index_input_valid?, #index_tokens, #query_tokens
Methods inherited from Field_or_Type
#==, #[], #[]=, #to_h, #to_xml, #to_xml_node
Constructor Details
#initialize(*args) ⇒ FieldType
Returns a new instance of FieldType.
19 20 21 22 |
# File 'lib/simple_solr_client/schema/field_type.rb', line 19 def initialize(*args) super @xml = nil end |
Instance Attribute Details
#core ⇒ Object
Returns the value of attribute core.
17 18 19 |
# File 'lib/simple_solr_client/schema/field_type.rb', line 17 def core @core end |
#solr_class ⇒ Object
Returns the value of attribute solr_class.
17 18 19 |
# File 'lib/simple_solr_client/schema/field_type.rb', line 17 def solr_class @solr_class end |
#xml ⇒ Object
Returns the value of attribute xml.
17 18 19 |
# File 'lib/simple_solr_client/schema/field_type.rb', line 17 def xml @xml end |
Class Method Details
.new_from_solr_hash(h) ⇒ Object
31 32 33 34 35 |
# File 'lib/simple_solr_client/schema/field_type.rb', line 31 def self.new_from_solr_hash(h) ft = super ft.solr_class = h['class'] ft end |
.new_from_xml(xml) ⇒ Object
Luckily, a nokogiri node can act like a hash, so we can just re-use #new_from_solr_hash
39 40 41 42 43 |
# File 'lib/simple_solr_client/schema/field_type.rb', line 39 def self.new_from_xml(xml) ft = new_from_solr_hash(Nokogiri.XML(xml).children.first) ft.xml = xml ft end |
Instance Method Details
#type ⇒ Object
Make sure the type is never set, so we don’t get stuck trying to find a type’s “type”
26 27 28 |
# File 'lib/simple_solr_client/schema/field_type.rb', line 26 def type nil end |