'Search query text, titles, and descriptions.
:qparam string q: Search term
Responds with a list of :ref:`query <query-response-label>` objects.'

@require_permission('view_query')
def get(self):

    term = request.args.get('q', '')
    include_drafts = (request.args.get('include_drafts') is not None)
    return [q.to_dict(with_last_modified_by=False) for q in models.Query.search(term, self.current_user.group_ids, include_drafts=include_drafts)]
