Zope's zCatalog is a way of creating indexes to improve performance.

Zwiki:HowToInstallAZwikiCatalog describes the manual process

  • it's not clear to me why many of those properties need to be indexed. For instance, lastEditTime is what it seems, but last_edit_time is its string representation, which seems unlikely to be searched or sorted on.

I want an automated process so I can do it on customer sites. Also my Get Slice problem makes it impossible to do it the manual way.

Zwiki:SetupIssue Tracker has an External Method to do the job.

I didn't think an External Method was was great approach, because

  • it doesn't seem to use acquisition for context, so you need to either pass a location as a parameter or set up the method within the target folder (which is how its written there) which gets back to my Get Slice problem

  • if you need to tweak it you have to work outside Zope, then get the ZMI to re-recognize the new version, which didn't seem automatic when I tried it.

But I tried it that way anyway just to avoid confusion. Hah.

Jun26 2003

Copied external method. Ripped out the pieces specific to the Issue Tracker.

  • but I did leave some of the properties. Maybe that was a bad idea?

Ran external method. Got error message "index already exists" (not the exact phrasing). No catalog created. Tried a couple times with the same result.

Tried creating a catalog by hand. Noticed that it added some index and Meta Data tables automatically.

Tried deleting that catalog, removing the automatically-added indexes from the external method, then running it again. No go.

Tried adding the catalog by hand, then tweaking the method so that it wouldn't create a new catalog, but just add indexes, etc. It gave me the same error message! But on inspection all the right stuff had been added to the catalog!


  • the code was designed for an empty folder, so I have to figure out how to automate the manage_findObjects function. There doesn't seem to be much documentation around for this.

  • still buried back in that Get Slice problem.

Unless I find a problem, I'll try and convert this to a Python Script and figure out the manage_findObjects piece to add. Or maybe I'll give a last try with the external method after ripping out the Issue Tracker properties.


Here's the list of commands. Here [are](http://web.jfroche.be/viewcvs.cgi/Z Photo Slides Folder.py?annotate=1.24) some samples.

tried a one-line script to create a catalog --BillSeitz, 2003/06/30 20:41 GMT
'catalog = [Z Catalog]'

But get 'You are not allowed to access Z Catalog in this context' - 90% sure this is because Python Script can't do so many things because of the Sand Box.

I wonder whether this approach will get me around the problem? Ugh, it looks like that would still require mucking around outside ZMI.

Haven't gotten a response re Python Script --BillSeitz, 2003/07/01 18:10 GMT
So maybe I'll face reality and get back to the ZopeGet SliceBug.

Yay, can get back to this - ZopeGet SliceBug solved --BillSeitz, 2003/07/16 22:09 GMT
Jon Udell article notes that acquisition applies to External Methods, too.

or another Python Script approach --BillSeitz, 2003/07/16 22:35 GMT
Dieter Maurer says use 'destinationFolder.manage_addProduct[ProductName].constructor(args)'

just do it manually for now --BillSeitz, 2003/07/17 15:54 GMT
My priority is to improve performance of the whole server by getting my big wiki indexed. I can play with other methods later.

hmm, it's still slow --BillSeitz, 2003/07/17 15:58 GMT
Apparently still not using the catalog - DTML code shows a 'bruteforce' flag, don't know where that's set, or whether it's obsolete.

just rip out pieces for now --BillSeitz, 2003/07/17 16:46 GMT
to force it to use the Catalog.

Unfortunately, references to 'src' for the contents of the blogbit pages kicks out garbage. I have an ugly feeling they'd need to be included in the Catalog. Unless maybe I do some sort of lookup from the page 'id' that's in the cache to the page contents that's not in the cache?

use Principia Search Source? --BillSeitz, 2003/07/17 21:54 GMT
When I created the catalog this was included as a default Index and Metadata column, and I didn't delete it.

So I thought - hey, maybe I can use that instead of 'src'.

But it has the same weird effect - it sucks in the Front Page contents instead of the indexed-page contents. Weird.

  • duh, just realized it has an index but not a metadata column

  • also, after deciding not to work with it for now, dumped its index to cut that overhead.

if add 'src' to metadata --BillSeitz, 2003/07/17 23:21 GMT
Don't do it directly, but make a Python Method to return just some subset of it (first 2000 chars).

Hmm, if done right could use this for non-blog pages, too. Or, maybe prefer to render canonicalLinks for those? Or both?

got response --BillSeitz, 2003/07/18 00:24 GMT
needed to use 'getObject()' and 'text()'

see Zwiki:ZwikiBlog

  • also there are other things to look at there

remember to fix test for catalog --BillSeitz, 2003/07/18 00:26 GMT
Ripped that out before.

And Zwiki:ZwikiBlog doesn't test - it just assumes there's a catalog.

other places to reference catalog --BillSeitz, 2003/07/18 21:52 GMT
Did it for:

  • RecentChanges

  • rss.xml

Not for:

Edited: |

blog comments powered by Disqus