Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Members / jhb / old blog entries / zcatalog

zcatalog

by Jörg Baach last modified Mar 29, 2006 03:27 PM
Playing around with Zopes ZCatalog

Today I am working a bit on some autocompletion feeding for our cts system.

First I am playing around TextIndexNG3:

* You can have multiple fields indexed, and query them seperately
* It seems to be possible to find out what words are in the Index

catalog.Indexes['fulltext'].index.getLexicon().getWordsForSubstring('foo')

* But it does not work ttw
* Therefore I have to write some trusted code (thanks AJung)
* I could not use ExternalMethods (they are not properly synced with
my version of FileSystemSite)
* Therefore I put some stuff in my Products __ini__.py:

from AccessControl import ModuleSecurityInfo
ModuleSecurityInfo('Products').declarePublic('CTS')
ModuleSecurityInfo('Products.CTS').declarePublic('callLexicon')


def callLexicon(catalog,indexname,method,*args,**kwargs):
lexicon =catalog.Indexes[indexname].index.getLexicon()
return getattr(lexicon,method)(*args,**kwargs)

* I don't get however why the Securitydeclarations have to be done
that way

Add comment

You can add a comment by filling out the form below. Plain text formatting.

Question: What is 6 times 7?
Your answer: