Class: ContentItemFieldType
- Inherits:
-
Cortex::FieldType
- Object
- Cortex::FieldType
- ContentItemFieldType
- Defined in:
- app/models/content_item_field_type.rb
Instance Attribute Summary collapse
-
#content_item_id ⇒ Object
Returns the value of attribute content_item_id.
Instance Method Summary collapse
- #data=(data_hash) ⇒ Object
- #elasticsearch_mapping ⇒ Object
- #field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
Instance Attribute Details
#content_item_id ⇒ Object
Returns the value of attribute content_item_id.
2 3 4 |
# File 'app/models/content_item_field_type.rb', line 2 def content_item_id @content_item_id end |
Instance Method Details
#data=(data_hash) ⇒ Object
8 9 10 |
# File 'app/models/content_item_field_type.rb', line 8 def data=(data_hash) @content_item_id = data_hash['content_item_id'] end |
#elasticsearch_mapping ⇒ Object
4 5 6 |
# File 'app/models/content_item_field_type.rb', line 4 def elasticsearch_mapping { name: mapping_field_name, type: :keyword, index: :not_analyzed } end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
12 13 14 15 16 |
# File 'app/models/content_item_field_type.rb', line 12 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['content_item_id'] json end |