Module: Elasticsearch::Model::CascadeUpdate
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/elasticsearch/model/cascade_update.rb
Instance Method Summary collapse
- #as_indexed_json(options = {}) ⇒ Object
-
#es_partial_update(*keys) ⇒ Object
update, just for a specific key, or set of keys.
Instance Method Details
#as_indexed_json(options = {}) ⇒ Object
18 19 20 |
# File 'lib/elasticsearch/model/cascade_update.rb', line 18 def as_indexed_json( = {}) self.class.to_indexed_json(self, ) end |
#es_partial_update(*keys) ⇒ Object
update, just for a specific key, or set of keys
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/elasticsearch/model/cascade_update.rb', line 7 def es_partial_update(*keys) keys = keys.map(&:to_s) res_json = {} keys.each do |key| res_json[key] = self.class.es_get_actor(key)[self] end self.__elasticsearch__.update_document_attributes res_json end |