Catalog.__init__(self, brains=brains)
self.zcat = zcat
- def getDelegatedIndexes(self) :
- return ('Title', 'Description', 'SearchableText') # <= TODO virer cette ligne
- return self.zcat.delegatedIndexes
-
def delegateSearch(self, query, plan) :
'''
retours faux :
None signifie : pas de délégation, il faut continuer à interroger les autres index.
IISet() vide : pas de résultat lors de la délégation, on peut arrêter la recherche.
'''
- indexes = set(plan).intersection(set(self.getDelegatedIndexes()))
+ indexes = set(plan).intersection(set(self.zcat.delegatedIndexes))
+ if not indexes :
+ return None
delegatedQuery = {}
for i in indexes :
delegatedQuery[i] = query.pop(i)
plan.remove(i)
- if not delegatedQuery :
- return None
- c = SolrConnection('http://localhost:8983/solr')
+ c = SolrConnection(self.zcat.solr_url)
q =' AND '.join(['%s:"%s"' % item for item in delegatedQuery.items()])
resp = c.query(q, fields='id', rows=len(self))
c.close()
<?xml version="1.0"?>
-<object name="portal_catalog" meta_type="CMF Catalog">
+<object name="portal_catalog" meta_type="Plinn Catalog">
<property name="title"></property>
<object name="htmltext_lexicon" meta_type="ZCTextIndex Lexicon">
<element name="UTF-8 HTML Aware splitter with accents removal"
<required tool_id="portal_calendar"
class="Products.Plinn.CalendarTool.CalendarTool"/>
<required tool_id="portal_catalog"
- class="Products.CMFCore.CatalogTool.CatalogTool"/>
+ class="Products.Plinn.catalog.CatalogTool"/>
<required tool_id="portal_discussion"
class="Products.CMFDefault.DiscussionTool.DiscussionTool"/>
<required tool_id="portal_groupdata"