(uid, top=0, sortedby=[])
return final
Return posts in search index most similar to given post.
Return posts in search index most similar to given post.
Return posts in search index most similar to given post .
def more_like_this(uid, top=0, sortedby=[]):
    """
    Return posts in search index most similar to given post.
    """

    top = top or settings.SIMILAR_FEED_COUNT
    fields = ['uid']
    found = whoosh_search(query=uid, sortedby=sortedby, fields=fields)

    if len(found):
        hits = found[0].more_like_this("content", top=top)
        # Copy hits to list and close searcher object.
        final = list(map(copy_hits, hits))
    else:
        final = []

    found.results.searcher.close()

    return final
def more_like_this ( uid , top = 0 , sortedby = [ ] ) : top = top or settings . SIMILAR_FEED_COUNT fields = [ 'uid' ] found = whoosh_search ( query = uid , sortedby = sortedby , fields = fields ) if len ( found ) : hits = found [ 0 ] . more_like_this ( "content" , top = top ) # Copy hits to list and close searcher object. final = list ( map ( copy_hits , hits ) ) else : final = [ ] found . results . searcher . close ( ) return final