From 412440dcfbb10849b8ed5207a123b95382f972c5 Mon Sep 17 00:00:00 2001 From: helmutm Date: Thu, 16 Jul 2009 10:19:56 +0000 Subject: [PATCH] make FullQuery also usable for full-text queries without children git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3459 fd906abe-77d9-0310-91a1-e0d9ade77398 --- expert/concept.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/expert/concept.py b/expert/concept.py index dc238b2..456fc3a 100644 --- a/expert/concept.py +++ b/expert/concept.py @@ -114,12 +114,16 @@ class BaseQuery(object): class FullQuery(BaseQuery): def query(self, text=None, type=None, useTitle=True, useFull=False, - conceptTitle=None, conceptUid=None, conceptType=None, **kw): + conceptTitle=None, conceptUid=None, conceptType=None, + withChildren=True, **kw): result = set() scores = {} intids = component.getUtility(IIntIds) - rc = self.queryConceptsWithChildren(title=conceptTitle, uid=conceptUid, - type=conceptType) + if withChildren: + rc = self.queryConceptsWithChildren(title=conceptTitle, uid=conceptUid, + type=conceptType) + else: + rc = self.queryConcepts(title=conceptTitle, type=type) if not rc and not text and '*' in type: # there should be some sort of selection... return ScoredSet(result, scores) if text or type != 'loops:*': # TODO: this may be highly inefficient!