[Zope-CMF] how to create an indexed attribute programmatically?

Shane Landrum srl at boston.com
Thu Jan 22 13:05:03 EST 2004


On Thu, Jan 22, 2004 at 12:01:28PM -0500, Shane Landrum wrote:
> 
> Looking at CMFCore/CatalogTool.py's _initIndexes method,
> it looks like you also need to run addColumn. I'm not sure
> what this does under the hood, but it seems like this may
> be your problem.

I'm wrong. You've added an index; now you need to make sure
the catalog knows about the new index for all the objects.
Try running catalogObject() over them.

> I have a related problem: I'm trying to add a new index
> to a CMF-based catalog that indexes a bunch of objects--- around
> several hundred thousand at least. I've got code that does
> this, and it runs fine on a development system with many
> fewer assets. When I deploy it on production, the reindexing
> takes forever--- it actually never completes. Where should
> I be looking to figure out how to solve this problem?

I've poked at this a bit more and have a refinement of my
question. What's the best strategy for changes to indexes
on large catalogs in production systems? Right now, I'm considering
not reindexing existing assets after adding an index--- rather,
just allowing new objects to be catalogged with the new index.

Since this is a newspaper system, with lots of objects
becoming less relevant over time, this isn't too bad a
tradeoff; I was just wondering what strategies other people
use for very large CMF asset stores.

srl
-- 
Shane Landrum, Software Engineer    srl at boston.com
boston.com / NY Times Digital



More information about the Zope-CMF mailing list