'Converts this instance into an Elasticsearch document'

@classmethod
def extract_document(cls, pk=None, obj=None):

    if (obj is None):
        obj = cls.get_model().objects.get(pk=pk)
    attach_trans_dict(cls.get_model(), [obj])
    attach_trans_dict(Webapp, [obj.app])
    doc = {'id': obj.id, 'app': obj.app_id, 'background_color': obj.background_color, 'color': obj.color, 'created': obj.created, 'image_hash': obj.image_hash, 'item_type': feed.FEED_TYPE_APP, 'preview': ({'id': obj.preview.id, 'thumbnail_size': obj.preview.thumbnail_size, 'thumbnail_url': obj.preview.thumbnail_url} if getattr(obj, 'preview') else None), 'pullquote_attribution': obj.pullquote_attribution, 'pullquote_rating': obj.pullquote_rating, 'search_names': list(set((string for (_, string) in obj.app.translations[obj.app.name_id]))), 'slug': obj.slug, 'type': obj.type}
    for field in ('description', 'pullquote_text'):
        doc.update(cls.extract_field_translations(obj, field))
    return doc
