[Zope3-dev] TTW Indexes

Martijn Faassen faassen@vet.uu.nl
Tue, 5 Aug 2003 11:55:57 +0200


Gary Poster wrote:
> Anthony Baxter wrote:
> >I want to do a reasonably large refactoring of the Indexes - there's 
> >4 types now (more if you include the case-insensitive varieties) and
> >they've all got slightly different interfaces for searching and indexing
> >objects. If I don't have to worry about the free-floating index objects,
> >then it's less work.
> 
> I really doubt I'll ever have a chance to do what I wanted with this, 
> so, for my part, go ahead and take what appears to be the easier 
> road--progress today is more important.  If I ever want to pursue my 
> design, I'll just do my own freestanding indexes based on the current 
> ones then.

What are the exact use cases the catalog and free standing indexes
try to fulfill?

I see two main limitations with the Zope 2 catalog:

  * attributes have to exist on the object with the same name of the
    indexes. This is going to be overcome, but still, attributes have
    to exist for the indexes to call. This can be overcome too with
    ProxyIndex.

  * it is hard to use multiple catalogs for the same objects. Objects
    really tend to belong to a single catalog. This means the catalog
    tries to index them for *all* indexes, even though that doesn't
    really make sense.

If both restrictions are lifted, the former by using interfaces and
adapters in some smart way to do indexing perhaps, and the latter by
having multiple catalogs listening in to the same events, I would
be happy.

What use cases exist for free-standing indexes?

> While a 
> catalog answers the use case of indexing a large set of objects in 
> myriad ways, what about a small mini-app that just wants to do a 
> free-text index of uploaded docs?  What about a tool that needs a single 
> type of index of its own data?

Couldn't you have a catalog with just one or two indexes that only
listens to events from the particular objects you care about?

Regards,

Martijn