original_docstring: 
          Persist an entity into Elasticsearch.
  
          
docstring: Persist an entity into Elasticsearch.
docstring_tokens: Persist an entity into Elasticsearch .
code: def create(self, instance, **kwargs):
          """
          Persist an entity into Elasticsearch.
  
          """
          now_millis = self.new_timestamp()
  
          if instance.id is None:
              instance.id = self.new_object_id()
  
          instance._id = instance.id
          instance.created_at = now_millis
          instance.updated_at = now_millis
  
          # NB: the DSL save function will overwrite existing records; use the raw client
          self.elasticsearch_client.create(
              id=instance.id,
              index=self.get_index_name(**kwargs),
              body=instance.to_dict(),
          )
          return instance
code_tokens: def create ( self , instance , ** kwargs ) : now_millis = self . new_timestamp ( ) if instance . id is None : instance . id = self . new_object_id ( ) instance . _id = instance . id instance . created_at = now_millis instance . updated_at = now_millis self . elasticsearch_client . create ( id = instance . id , index = self . get_index_name ( ** kwargs ) , body = instance . to_dict ( ) , ) return instance
short_docstring: Persist an entity into Elasticsearch.
short_docstring_tokens: Persist an entity into Elasticsearch .
comment: """
          Persist an entity into Elasticsearch.
  
          """$SEP$# NB: the DSL save function will overwrite existing records; use the raw client