def _resolveQuery(self, session, objects, query):
"""Resolve a L{Query}.
@param session: The L{FluidinfoSession} for the request.
@param objects: The L{SecureObjectAPI} to use to fetch object IDs.
@param query: The L{Query} to resolve.
@return: A C{list} of object ID C{str}s that match the query.
"""
try:
result = objects.search([query])
except UnknownPathError as error:
session.log.exception(error)
unknownPath = error.paths[0]
raise TNonexistentTag(unknownPath.encode('utf-8'))
except PermissionDeniedError as error:
session.log.exception(error)
deniedPath, operation = error.pathsAndOperations[0]
raise TNonexistentTag(deniedPath)
try:
with session.timer.track('index-search'):
result = blockingCallFromThread(reactor, result.get)
except SearchError as error:
session.log.exception(error)
raise TParseError(query, error.message)
return result[query]
评论列表
文章目录