'Extracts interesting thing from a Thread and its Posts'

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

    if (obj is None):
        model = cls.get_model()
        obj = model.objects.select_related('last_post').get(pk=obj_id)
    d = {}
    d['id'] = obj.id
    d['model'] = cls.get_mapping_type_name()
    d['url'] = obj.get_absolute_url()
    d['indexed_on'] = int(time.time())
    d['created'] = int(time.mktime(obj.created.timetuple()))
    if (obj.last_post is not None):
        d['updated'] = int(time.mktime(obj.last_post.created.timetuple()))
    else:
        d['updated'] = None
    d['post_forum_id'] = obj.forum.id
    d['post_title'] = obj.title
    d['post_is_sticky'] = obj.is_sticky
    d['post_is_locked'] = obj.is_locked
    d['post_replies'] = obj.replies
    author_ids = set()
    author_ords = set()
    content = []
    posts = Post.objects.filter(thread_id=obj.id).select_related('author')
    for post in posts:
        author_ids.add(post.author.id)
        author_ords.add(post.author.username)
        content.append(post.content)
    d['post_author_id'] = list(author_ids)
    d['post_author_ord'] = list(author_ords)
    d['post_content'] = content
    return d
