[Zope] ZCatalog in 2.2.x

Terry Kerr terry@adroit.net
Fri, 01 Sep 2000 05:53:52 +1100


Hi,

I can rebuild indexes and recatalog etc, it doesn't change anything.  I
don't see how it could change anything...it is a brand new zcatalog
instance.  Simply, the ZCatalog is created, the indexes are created, and
the zcatalog is initially empty.  Then I create one CatalogAware object,
and it catalogs itself.  I can see this object in the catalog, and I can
see the textindexed words in the vocabulary.  But when I search for a word
in the vocabulary using a textindex (which obviously belongs to the only
object in the catalog), I get an empty result.  The only way I can get a
non empty result it to search for the id of the object or one other
property I have which are indexed as field indexes.

The product I am working on is Etailer.  If anyone is kind enough to take a
look, you can download it at http://e-tailer.adriot.net/download.html.  The
function that does the search is searchFor(), at line 419 of Etailer.py.
Creating an instance of etailer in 2.1.6 works fine, but creating an
instance of etailer in 2.2.x and the catalog doesn't work.


i am very confused ;-).


Chris McDonough wrote:

> This is not right, obviously.  Can you rebuild your indexes (by deleting
> and reentering them), recatalog, and see if the problem goes away?  We
> haven't had any colluding reports of something like this, and I'm using
> the 2.2.1 catalog with textindexes successfully on a customer project.
>
> > -----Original Message-----
> > From: Terry Kerr [mailto:terry@adroit.net]
> > Sent: Wednesday, August 30, 2000 3:27 AM
> > To: pja@clari.net.au; zope@zope.org
> > Subject: Re: [Zope] ZCatalog in 2.2.x
> >
> >
> > I am not searching from a form in that sense...I am talking
> > about at the python
> > level.
> >
> > I have self.searchResults({'description':'blah'})  where
> > description is meta
> > data in the catalog and a textindex and 'blah' is in the
> > Vocabulary.  This
> > previously worked in zope2.1.6.  Now in 2.2.0 and 2.2.1 it
> > doesn't work.  The
> > only thing way I can get searchResults() to return a non
> > empty list is to search
> > using a Field index and a valid string to match with.
> >
> >
> > pja@clari.net.au wrote:
> >
> > > Terry Kerr <terry@adroit.net> 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
> > > stuff.
> > >
> > > Peter Armstrong
> >
> > --
> > Terry Kerr (terry@adroit.net)
> > Adroit Internet Solutions Pty Ltd (www.adroit.net)
> > Phone:   +613 9563 4461
> > Fax:     +613 9563 3856
> > Mobile:  +61 414 938 124
> > ICQ:     79303381
> >
> >
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

--
Terry Kerr (terry@adroit.net)
Adroit Internet Solutions Pty Ltd (www.adroit.net)
Phone:   +613 9563 4461
Fax:     +613 9563 3856
Mobile:  +61 414 938 124
ICQ:     79303381