(result, highlight=False)
return bunched
Copy the items in results into a dict.
Copy the items in results into a dict.
Copy the items in results into a dict .
def copy_hits(result, highlight=False):
    """
    Copy the items in results into a dict.
    """
    # Highlight title and content
    if highlight:
        title = result.highlights("title", minscore=0) or result.get('title')
        content = result.highlights("content", top=5, minscore=0) or result.get('content')
        tags = result.highlights("tags", minscore=0) or result.get('tags')
    else:
        title = result.get('title')
        content = result.get('content')
        tags = result.get('tags')

    bunched = dict(title=title,
                   content=content,
                   uid=result.get('uid'),
                   tags=tags,
                   author=result.get('author'),
                   lastedit_date=result.get('lastedit_date'))
    return bunched
def copy_hits ( result , highlight = False ) : # Highlight title and content if highlight : title = result . highlights ( "title" , minscore = 0 ) or result . get ( 'title' ) content = result . highlights ( "content" , top = 5 , minscore = 0 ) or result . get ( 'content' ) tags = result . highlights ( "tags" , minscore = 0 ) or result . get ( 'tags' ) else : title = result . get ( 'title' ) content = result . get ( 'content' ) tags = result . get ( 'tags' ) bunched = dict ( title = title , content = content , uid = result . get ( 'uid' ) , tags = tags , author = result . get ( 'author' ) , lastedit_date = result . get ( 'lastedit_date' ) ) return bunched