[Zope-Coders] Proposal for minor ZCatalog improvement

Andreas Jung andreas@andreas-jung.com
Sat, 09 Nov 2002 10:45:44 +0100


All ZCatalog indexes are using the id of the indexes to index attributes
with the same name. ZCTextIndex introduced a new approach by seperating
the id of the index from the attribute name to be indexed. This is a nice
idea and allows to have different indexes on the same attribute name
(e.g. having a FieldIndex and a text index on a string attribute).

I propose add this functionality to all Zope indexes. All interface for
pluggable indexes should get a new method getIndexedAttribute() that
returns the name of the attribute that will be indexed by this index.
The indexes tab of the ZCatalog should be modified to display the
indexes as:

topic_txt  (TextIndex on topic) ...
topic_field (FieldIndex on topic)

For backwards compatiblity getIndexedAttribute() would  return the
id of the index if the indexes has no dedicated attribute to keep
the name of the indexed attribute.

Cheers,
Andreas

    ---------------------------------------------------------------------
   -    Andreas Jung                     http://www.andreas-jung.com   -
  -   EMail: andreas at andreas-jung.com                              -
   -            "Life is too short to (re)write parsers"               -
    ---------------------------------------------------------------------