Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Remove search endpoint as its equal to G endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodbare committed Sep 16, 2020
1 parent 67863b2 commit 1895bf3
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions guillotina_cms/api/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,6 @@
from collections import Counter


@configure.service(
context=IResource, method='GET', permission='guillotina.AccessContent', name='@search',
summary='Make search request',
responses={
"200": {
"description": "Search results",
"type": "object",
"schema": {
"$ref": "#/definitions/SearchResults"
}
}
})
async def search_get(context, request):
query = request.query.copy()
search = get_search_utility(query)
if search is None:
return {
'@id': request.url,
'items': [],
'items_total': 0
}

parsed_query = parse_query(context, query, search)
container = find_container(context)
result = await search.search(container, parsed_query)
result['@id'] = request.url
result['batching'] = {
'from': parsed_query['_from'] or 0,
'size': parsed_query['size']
}
return result


@configure.service(
context=IResource, method='GET', permission='guillotina.AccessContent', name='@suggestion',
summary='Make search request',
Expand Down

0 comments on commit 1895bf3

Please sign in to comment.