[Zope-dev] Change Request in TextIndex implementation

Chris Withers chrisw@nipltd.com
Tue, 31 Jul 2001 17:51:17 +0100


Casey Duncan wrote:
> 
> In a world of implicit aquisition, this strikes me as very bad form. For
> this to work, the vocabulary must reside in the parent of the parent of
> the index, which must be a mapping object for it to find it. This is not
> the case with my implementation, in fact the vocabulary can be basically
> anywhere above the index.

Yeah, I put a bug in the tracker kindof related to this. You'll find that if you
add a vocabulary above the ZCatalogs in the acquisition path, you won't get to
choose which splitter you use since that choice requires an attribute to be
present that is defined in the __init__ method of ZCatalog. This also means that
you get the same efefct if you try and add a new vocabulary to an old ZCatalog
instance :-(

> Of course, I could simply pass in the lexicon when the Index is
> instantiated. This is great and wonderful, except, I would like to
> support Zope 2.3 in as seemless a way possible. Writing crap like this
> bothers me (although I have little choice at this point methinks):

The PluginIndex stuff does seem a bit scrappy in places :-S

I don't like the Indexes tab, jumping context like that doesn't work for me...

There also seem to be an awful lot of exec statements in the PluginIndexes code
which always make me nervous, and now that I've got up close an personal with
it, it seems to be very difficult to do what I actually want; create news types
of indexes, splitters, lexicons, vocabularies, etc by subclassing the ones
already there.

What do other people think?

cheers,

Chris

Women have bad hair days, I have bad Zope days, this is one of them ;-)