Terry Kerr <[EMAIL PROTECTED]> said: 

> Hi,
> I have a python product which uses a ZCatalog and CatalogAware
> products.  The catalog has a number of Field and TextIndex indexes.
> Search the ZCatalog has worked fine when my product is instantiated in
> 2.1.6.  But now when I instantiate my product in 2.2.0 or 2.2.1,
> searching only works when I search using a field index.  Searching using
> a textindex always results in an empty result, even tho I can see the
> words I am searching for in the Vocabulary!  Any suggestions?  I have
> tried reindexing, completey recreating the Zcatalog, recreating the
> Vobulary and reindexing, and nothing has changed the behaviour.  Are
> textindexes simply broken?
> ZCatalog seems very volatile to me!  Every time I have upgraded way back
> from zope2.1.3, something in zcatalog has changed and boken my product.
> So far I have managed to find fixes, but this one has got me baffled!!

My experience has been that if field indexes are unspecified, the catalog 
will only match where those fields are empty.  In other words, by not 
specifing anything for the field indexes, you are actually specifying that 
for a match, they need to be empty.
To get around this, I put another method between the form for entering what 
you wish to search for, and the method that actually searches the form.  This 
method looks at the field indexes, and if nothing has been specified, it 
doesn't pass them on to the method that does the actual search.
An alternative to this, is to use names for the field indexes that aren't in 
the catalog index, and then at the start of the search method, check those 
names, and if they have a value associated with them, add to REQUEST what the 
names in the index are with the appropriate values.

There may be a better way, I'm still pretty new to Zope and DTML sort of 

Peter Armstrong

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to