[Zope-dev] feedback wanted on ZCatalog changes...

Michel Pelletier michel@digicool.com
Tue, 4 Jan 2000 11:09:31 -0500


> -----Original Message-----
> From: Anthony Baxter [mailto:anthony@interlink.com.au]
> Sent: Wednesday, December 29, 1999 3:05 AM
> To: zope-dev@zope.org
> Subject: [Zope-dev] feedback wanted on ZCatalog changes...
> 
> 
> At <URL:http://www.zope.org/Members/anthony/patches/index_html>
> I've placed a number of changes/patches for ZCatalog. As well
> as a couple of bug fixes (which are in the collector) there's a
> new feature - I've added a new management tab 'Query'. from the above
> page:
> 
> A new management tab 'Query', which allows you to query the 
> contents of
> the ZCatalog. When building complex applications with ZCatalog (see my
> 'dtml-tree from zcatalog' howto), you end up writing a lot of 
> tiny DTML
> methods just to dump out the results of a particular query. This makes
> it a lot easier. Note that this is pretty shiny and new, and 
> I'd really
> like some feedback on this.

It sounds pretty cool.  The whole idea of a "query language" is one of
those open ended issues.  Scott@codeit has come up with some interesting
stuff and so has Phillip Eby.  I think the query language part should be
resolved before a UI for it is built.

So I suggest that we table the issue for a bit WRT anyhting involving
queries.  I like the idea of your screen and think it should be added as
feature to the next 'revision' of catalog.

Is it possible to get diffs of your bug fixes so that I can look over
them and check them in?

> There's two search methods - one takes an index and a search term, and
> will return matching objects (and optionally display all metadata in a
> table), while the other will take an index and do a uniqueValuesFor()
> on it to return a list of index values.  Clicking on a result in this
> form will return matching objects for that value (as in the 
> first method)
> 
> Note that this will only work for indexes of type FieldIndex and
> KeyWordIndex. To detect TextIndexes, I had to check for the 
> presence of
> a method called 'positions' in the index, since that's only present in
> TextIndex. There appears to be no way to find out the type of an index
> apart from diving into Python and examining it's __class__. 
> Should this
> be fixed? 

Well, one school of thought says that all indexes should conform to a
common interface.  Indexes 'sort of' work this way, but text indexes
have a slightly diff interface and certain operations for various
indexes may or may make sense (like uniqueValuesFor).

What really needs to happen is that this whole index snafu which I so
briliantly screwed Zope into needs to be fixed.  The index interface
should be modeled, documented, and made consistent across types of
index.  The problem with this is that the ideal solution would probably
not be (or require more work to be) backwards compatable with Confera,
Squishdot, Catalog and ZTables.  Aie.

-Michel