Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
On search, query based on the context of the object
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Navarro Bosch committed Jan 3, 2017
1 parent c74f0fd commit 15906b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/plone.server/plone/server/api/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from plone.server.api.service import Service
from plone.server.interfaces import ICatalogUtility
from zope.component import queryUtility
from plone.server.utils import get_content_path


class SearchGET(Service):
Expand All @@ -27,7 +28,10 @@ async def __call__(self):
'member': []
}

return await search.query(self.context, q)
return await search.get_by_path(
site=self.request.site,
path=get_content_path(self.context),
query=q)


class ReindexPOST(Service):
Expand Down
2 changes: 1 addition & 1 deletion src/plone.server/plone/server/catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def get_object_by_uuid(self, uuid):
async def get_by_type(self, doc_type, query={}):
pass

async def get_by_path(self, path, depth, doc_type=None):
async def get_by_path(self, site, path, depth=-1, query={}, doc_type=None):
pass

async def get_folder_contents(self, obj):
Expand Down

0 comments on commit 15906b6

Please sign in to comment.