[Zope] how to unindex an non existing (deleted)object

2008-06-24 Thread robert rottermann

Hi there,

Sometimes a catalog query returns brains that point to non existing objects.

how can I remove such brains from the index programmatically  without using the 
portal_catalag/advanced/update tab?


thanks
robert
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to unindex an non existing (deleted)object

2008-06-24 Thread Martijn Jacobs

robert rottermann wrote:

Hi there,

Sometimes a catalog query returns brains that point to non existing 
objects.


how can I remove such brains from the index programmatically  without 
using the portal_catalag/advanced/update tab?


thanks
robert
If you want to call the update catalog functionality yourself : A 
Zcatalog has a method refreshCatalog which you can use (take a look at 
ZCatalog.py).


If you want to remove the brain you could call the 
_catalog.uncatalogObject method.However, when you have brains which 
point to non-existent objects you should reindex the catalog, as 
something went wrong while (un)indexing these objects.



Martijn.

--
Martijn Jacobs
Four Digits, Internet Solutions

a: Willemsplein 15-1 6811 KB Arnhem NL 
kvk: 09162137 | btw: 8161.22.234.B01

e-mail: [EMAIL PROTECTED] | web: http://www.fourdigits.nl
tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117 


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to unindex an non existing (deleted)object

2008-06-24 Thread robert rottermann

Martijn Jacobs schrieb:

robert rottermann wrote:

Hi there,

Sometimes a catalog query returns brains that point to non existing 
objects.


how can I remove such brains from the index programmatically  without 
using the portal_catalag/advanced/update tab?


thanks
robert
If you want to call the update catalog functionality yourself : A 
Zcatalog has a method refreshCatalog which you can use (take a look at 
ZCatalog.py).


If you want to remove the brain you could call the 
_catalog.uncatalogObject method.However, when you have brains which 
point to non-existent objects you should reindex the catalog, as 
something went wrong while (un)indexing these objects.



Martijn.



thanks very much.
robert
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )