original_docstring: 
          Creates a dict representation an Elasticsearch document.
  
          include_index and include_source can be set to False when the _index and/or _source keys
          aren't required (e.g. when using `datahub.search.deletion.delete_documents()`).
          
docstring: Creates a dict representation an Elasticsearch document.
  include_index and include_source can be set to False when the _index and/or _source keys
  aren't required `).
docstring_tokens: Creates a dict representation an Elasticsearch document . include_index and include_source can be set to False when the _index and / or _source keys aren ' t required ` ) .
code: def es_document(cls, db_object, index=None, include_index=True, include_source=True):
          """
          Creates a dict representation an Elasticsearch document.
  
          include_index and include_source can be set to False when the _index and/or _source keys
          aren't required (e.g. when using `datahub.search.deletion.delete_documents()`).
          """
          doc = {
              '_id': db_object.pk,
          }
  
          if include_index:
              doc['_index'] = index or cls.get_write_alias()
  
          if include_source:
              doc['_source'] = cls.db_object_to_dict(db_object)
  
          return doc
code_tokens: def es_document ( cls , db_object , index = None , include_index = True , include_source = True ) : doc = { '_id' : db_object . pk , } if include_index : doc [ '_index' ] = index or cls . get_write_alias ( ) if include_source : doc [ '_source' ] = cls . db_object_to_dict ( db_object ) return doc
short_docstring: Creates a dict representation an Elasticsearch document.
short_docstring_tokens: Creates a dict representation an Elasticsearch document .
comment: """
          Creates a dict representation an Elasticsearch document.
  
          include_index and include_source can be set to False when the _index and/or _source keys
          aren't required (e.g. when using `datahub.search.deletion.delete_documents()`).
          """