[Zope-dev] Shared lexicons for ZCTextIndex (was: Re: [Zope-Checkins] CVS: Zope/lib/python/Products/ZCTextIndex - ZCTextIndex.py:1.32)

Jim Fulton jim@zope.com
Thu, 15 Aug 2002 10:17:56 -0400


Casey Duncan wrote:
> On Thursday 15 August 2002 09:21 am, Jim Fulton wrote:
> 

...

> I'm not sure what you mean. The pipelining is defined and executed in the 
> lexicon.

My mistake.


> 
>>I think that there is at least potential value in sharing lexicons.
>>Of course, a down side is that it complicates set up.
>>
> 
> I guess the main complaint was that given a set of indexes sharing a lexicon, 
> deleting the lexicon and replacing it with another one had no effect on the 
> indexes and in fact removes your ability to manage their lexicon at all. So 
> you must replace all of the indexes to use the new lexicon by hand.
> 
> Admittedly this is really more of a user interface and management issue then 
> anything. Zope is just not very good at managing one to many relationships 
> unless the one is the container of the many. 8^(

Maybe that's not Zope's job. Perhaps the lexicon should keep track of the indexes
using it. Then, if you try to delete it, you'd at least get a warning letting
you know that you may need to recreate a bunch of indexes, and telling you
which ones.


> 
>>On the subject of referencing lexicons by path rather than using direct
>>references, I'm inclined to agree that direct references are better for
>>simplicity and speed. It's easy enough to add a new index when you
>>want to change a lexicon. (Well, there are some complications having to do
>>with making sure that you get all the needed data into the new index...)
>>
> 
> The current fix is a compromise that does a traversal as seldom as possible. 
> unfortunately it means it must be even more complex then either a simple 
> direct ref or path reference would be.

Yup, and this brittle.


> I'm thinking about adopting an alternative fix, which keeps the direct 
> reference and the path to the lexicon and gives you a management interface to 
> select a new lexicon or simply connect to a replacement (which would clear 
> the index). It could also tell you if the lexicon used by the index is the 
> actual one referenced from the path. 

That sounds OK.

Jim


-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org