[Zope-dev] Keyword Indexes in ZCatalogs

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Sun, 21 Nov 1999 11:56:04 +1100 (EST)


On Sat, 20 Nov 1999, Alexandre Ratti wrote:

> Could someone explain how to use Keyword Indexes in ZCatalogs? In a 
> ZCatalog, we now have 3 index types: Text Index, Field Indexes and Keyword 
> Indexes.
> 
> Here is the information I have found so far about the Keyword type:
> 
> "Keyword Indexes index a sequence of objects that act as 'keywords' for an
> object. A Keyword Index will return any objects that have one or more
> keywords specified in a search query."
> (source: Indexes tab of a Zcatalog)
> 
> "Keyword Index: Subclasses all of the field index behavior, except that
> property values are treated as a sequence of keywords."
> (source: posting on a Zope list)
> 
> Could someone provide an implementation example?

I have a ZClass with a 'lines' type property (a list) called course_logs

If I then search using:
    <dtml-in "Catalog(course_logs='Feedback')">
This returns all catalog entrys which contain 'Feedback' as one
of the course_logs elements. This is essential for building many-many 
relationships.

-- 
 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen