@decorators.api_view(['GET'])
@decorators.permission_classes((permissions.AllowAny,))
@decorators.renderer_classes((JSONRenderer,))
def section_search(request):
 query = request.GET.get('q', None)
 if (not query):
  return Response({'error': 'Search term required. Use the "q" GET arg to search. '}, status=status.HTTP_400_BAD_REQUEST)
 project_slug = request.GET.get('project', None)
 version_slug = request.GET.get('version', LATEST)
 path = request.GET.get('path', None)
 log.debug('(API Section Search) [%s:%s] %s', project_slug, version_slug, query)
 results = search_section(request=request, query=query, project_slug=project_slug, version_slug=version_slug, path=path)
 return Response({'results': results})

@ decorators . api_view ( [ 'GET' ] ) @ decorators . permission_classes ( ( permissions . AllowAny , ) ) @ decorators . renderer_classes ( ( JSONRenderer , ) ) def section_search ( request ) : query = request . GET . get ( 'q' , None ) if ( not query ) : return Response ( { 'error' : 'Search term required. Use the "q" GET arg to search. ' } , status = status . HTTP_400_BAD_REQUEST ) project_slug = request . GET . get ( 'project' , None ) version_slug = request . GET . get ( 'version' , LATEST ) path = request . GET . get ( 'path' , None ) log . debug ( '(API Section Search) [%s:%s] %s' , project_slug , version_slug , query ) results = search_section ( request = request , query = query , project_slug = project_slug , version_slug = version_slug , path = path ) return Response ( { 'results' : results } )
section search queries with query q across all documents and projects .