[Zope-dev] Re: ZCatalog fast as admin, dog slow as anonymous and other users

Tres Seaver tseaver at zope.com
Fri Jan 30 17:28:19 EST 2004


Jason Spisak wrote:
> Tres and Seb,
> 
> Got rid of all the date FieldIndexes and am reindexing the new 
> DateIndexes one at a time from the indexes tab, but I've hit a snag.
> 
> when I go to reindex 'expires' I get this error immediately:
> 
> Site error
> 
> This site encountered an error trying to fulfill your request. The 
> errors were:
> Error Details
> 
> Error Type
> OverflowError
> 
> Error Value
> integer multiplication

Update lib/python/Products/PluginIndexesn/DateIndex/DateIndex.py to the 
current head of the 2.6 branch, e.g. from:

As a quick workaround, you could patch CMFDefault/DublinCore.py::

---------------- 8< -----------------------------------
*** CMFDefault/DublinCore.py    14 Nov 2002 06:48:20 -0000      1.19.4.3
--- CMFDefault/DublinCore.py    30 Jan 2004 22:22:53 -0000
***************
*** 253,259 ****
               date = getattr( self, 'creation_date', None )
           return date is None and self.__FLOOR_DATE or date

!     __CEILING_DATE = DateTime( 9999, 0 ) # never expires

       security.declarePublic( 'expires' )
       def expires( self ):
--- 253,259 ----
               date = getattr( self, 'creation_date', None )
           return date is None and self.__FLOOR_DATE or date

!     __CEILING_DATE = DateTime( 2037, 0 ) # never expires

       security.declarePublic( 'expires' )
       def expires( self ):
---------------- 8< -----------------------------------

The better fix would involve not returning the silly _CEILING_DATE at 
all, and then telling the index whether to treat 'None' as low or high.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope-Dev mailing list