[Zope-Coders] Re: [Zope-Checkins] CVS:
Zope/lib/python/Products/PluginIndexes/DateRangeIndex -
DateRangeIndex.py:1.6.2.2
Casey Duncan
casey at zope.com
Wed Nov 19 09:33:47 EST 2003
On Wed, 19 Nov 2003 11:35:24 +0100
Andreas Jung <andreas at andreas-jung.com> wrote:
[snip]
>
> Speaking of indexes: it is currently impossible in the CMF to specify
> a ZCTextIndex inside enumerateIndexes(). So when you create a new
> CMF site the old crappy TextIndexes are used (which sucks). Btw.
> using TextIndexNG in enumerateIndexes() works fine (*wink*).
Yeah that basically because the API to create ZCTextIndexes kinda sucks (which I can say truthfully because I wrote that part). I've been meaning to fix that for a while now, but so far I haven't found the time.
OTOH enumerateIndexes is pretty strange in and of itself. Given the number of ZCTextIndex options it isn't clear to me how to make it work within that framework without changing CMF too. Actually I have a version of the catalog tool that is able to create ZCTextIndexes from enumerateIndexes. It overrides _initIndexes to do it though which I suppose i fine.
The problem is that we no longer live in a world with 3 index types. Now we have n. The ZCatalog addIndex api assumes that catalog knows about all of the index types you might want to add. That's just not the case now. I think it would be wise to deprecate that api and migrate application code to use the ObjectManager api (I use the term loosely ;^) to manipulate ZCatalog.Indexes directly.
-Casey
More information about the Zope-Coders
mailing list