def annotations_index(request): """Do a search for all annotations on anything and return results. This will use the default limit, 20 at time of writing, and results are ordered most recent first. """ user = get_user(request) return search_lib.index(user=user)
def annotations_index(request): """Do a search for all annotations on anything and return results. This will use the default limit, 20 at time of writing, and results are ordered most recent first. """ search_normalized_uris = request.feature('search_normalized') user = get_user(request) results = search_lib.index(user=user, search_normalized_uris=search_normalized_uris) return { 'total': results['total'], 'rows': [search_lib.render(a) for a in results['rows']], }
def test_index_limit_is_20(search_func): """index() calls search with "limit": 20.""" search.index() first_call = search_func.call_args_list[0] assert first_call[0][0]["limit"] == 20