On Tue, Dec 06, 2005 at 10:41:02AM -0700, Jeff Shell wrote:
> > 1. How do I search the catalog?
> catalog = zapi.getUtility(ICatalog, 'catalog', self.context)
> results = self._results = catalog.searchResults(textindexname='text to
> search for', fieldindexname=('low value', 'high value'))
I successfully managed to search my zope-site. Now I want a more
"future-proof" solution. I'd like to have a google-like search engine on my
site which means:
* Somes words needs to be typed
* A List of results is shown, containing all content objects where all
words of the search query occur.
* The search is not restricted to some special fields - I just want
*everything* to be searched.
1. Define an interface
"""Returns the objects text"""
"""Returns a name/title of the object"""
"""Returns some few words from the beginning of the content"""
2. Use a catalog and a text-index to index all ISearchable-implementing
objects (field getContent,callable)
3. Write Adapters for all content-classes used on my zope-server, adapting
Is this a "good" idea?
One more question:
How do I use adapters in python? I've got an object implementing interface
'IFoo'. How to I turn it into an object implementing 'IBar'?
Zope3-users mailing list