module Mongoid::Elasticsearch::Indexing

Public Instance Methods

as_indexed_json() click to toggle source
# File lib/mongoid/elasticsearch/indexing.rb, line 6
def as_indexed_json
  serializable_hash.reject { |k, v| %w(_id c_at u_at created_at updated_at).include?(k) }
end
es_index?() click to toggle source
# File lib/mongoid/elasticsearch/indexing.rb, line 10
def es_index?
  true
end
es_update() click to toggle source
# File lib/mongoid/elasticsearch/indexing.rb, line 14
def es_update
  if destroyed? || !es_index?
    self.class.es.remove_item(self)
  else
    self.class.es.index_item(self)
  end
end