'Search for seen entries'

@etag
@api.response(NotFoundError)
@api.response(200, u'Successfully    retrieved    seen    objects', seen_search_schema)
@api.doc(parser=seen_search_parser, description=u'Get    seen    entries')
def get(self, session):

    args = seen_search_parser.parse_args()
    value = args[u'value']
    local = args[u'local']
    page = args[u'page']
    per_page = args[u'per_page']
    sort_by = args[u'sort_by']
    sort_order = args[u'order']
    if (per_page > 100):
        per_page = 100
    descending = (sort_order == u'desc')
    if value:
        value = unquote(value)
        value = u'%{0}%'.format(value)
    start = (per_page * (page - 1))
    stop = (start + per_page)
    kwargs = {u'value': value, u'status': local, u'stop': stop, u'start': start, u'order_by': sort_by, u'descending': descending, u'session': session}
    total_items = seen.search(count=True, **kwargs)
    if (not total_items):
        return jsonify([])
    raw_seen_entries_list = seen.search(**kwargs).all()
    converted_seen_entry_list = [entry.to_dict() for entry in raw_seen_entries_list]
    total_pages = int(ceil((total_items / float(per_page))))
    actual_size = min(len(converted_seen_entry_list), per_page)
    if ((page > total_pages) and (total_pages != 0)):
        raise NotFoundError((u'page    %s    does    not    exist' % page))
    pagination = pagination_headers(total_pages, total_items, actual_size, request)
    rsp = jsonify(converted_seen_entry_list)
    rsp.headers.extend(pagination)
    return rsp
