[Zope-Checkins] SVN: Zope/trunk/src/Products/PluginIndexes/ - added 'indexSize' to IPluggableIndex
Yvo Schubbe
y.2009 at wcm-solutions.de
Sat Jul 4 06:46:35 EDT 2009
Log message for revision 101506:
- added 'indexSize' to IPluggableIndex
Changed:
U Zope/trunk/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
U Zope/trunk/src/Products/PluginIndexes/PathIndex/PathIndex.py
U Zope/trunk/src/Products/PluginIndexes/TopicIndex/TopicIndex.py
U Zope/trunk/src/Products/PluginIndexes/common/UnIndex.py
U Zope/trunk/src/Products/PluginIndexes/interfaces.py
-=-
Modified: Zope/trunk/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
===================================================================
--- Zope/trunk/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py 2009-07-04 10:46:19 UTC (rev 101505)
+++ Zope/trunk/src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py 2009-07-04 10:46:35 UTC (rev 101506)
@@ -300,18 +300,6 @@
return result, ( self._since_field, self._until_field )
#
- # ZCatalog needs this, although it isn't (yet) part of the interface.
- #
- security.declareProtected(view , 'numObjects')
- def numObjects( self ):
- """ """
- return len( self._unindex )
-
- def indexSize(self):
- """ """
- return len(self)
-
- #
# Helper functions.
#
def _insertForwardIndexEntry( self, since, until, documentId ):
Modified: Zope/trunk/src/Products/PluginIndexes/PathIndex/PathIndex.py
===================================================================
--- Zope/trunk/src/Products/PluginIndexes/PathIndex/PathIndex.py 2009-07-04 10:46:19 UTC (rev 101505)
+++ Zope/trunk/src/Products/PluginIndexes/PathIndex/PathIndex.py 2009-07-04 10:46:35 UTC (rev 101506)
@@ -193,11 +193,11 @@
return results
def numObjects(self):
- """ return the number distinct values """
+ """Return the number of indexed objects."""
return len(self._unindex)
def indexSize(self):
- """ return the number of indexed objects"""
+ """Return the size of the index in terms of distinct values."""
return len(self)
def __len__(self):
Modified: Zope/trunk/src/Products/PluginIndexes/TopicIndex/TopicIndex.py
===================================================================
--- Zope/trunk/src/Products/PluginIndexes/TopicIndex/TopicIndex.py 2009-07-04 10:46:19 UTC (rev 101505)
+++ Zope/trunk/src/Products/PluginIndexes/TopicIndex/TopicIndex.py 2009-07-04 10:46:35 UTC (rev 101506)
@@ -85,8 +85,13 @@
return 1
def numObjects(self):
+ """Return the number of indexed objects."""
return "n/a"
+ def indexSize(self):
+ """Return the size of the index in terms of distinct values."""
+ return "n/a"
+
def search(self,filter_id):
if self.filteredSets.has_key(filter_id):
return self.filteredSets[filter_id].getIds()
Modified: Zope/trunk/src/Products/PluginIndexes/common/UnIndex.py
===================================================================
--- Zope/trunk/src/Products/PluginIndexes/common/UnIndex.py 2009-07-04 10:46:19 UTC (rev 101505)
+++ Zope/trunk/src/Products/PluginIndexes/common/UnIndex.py 2009-07-04 10:46:35 UTC (rev 101506)
@@ -277,11 +277,11 @@
return datum
def numObjects(self):
- """ return number of indexed objects """
+ """Return the number of indexed objects."""
return len(self._unindex)
def indexSize(self):
- """ return of distinct values indexed"""
+ """Return the size of the index in terms of distinct values."""
return len(self)
def unindex_object(self, documentId):
Modified: Zope/trunk/src/Products/PluginIndexes/interfaces.py
===================================================================
--- Zope/trunk/src/Products/PluginIndexes/interfaces.py 2009-07-04 10:46:19 UTC (rev 101505)
+++ Zope/trunk/src/Products/PluginIndexes/interfaces.py 2009-07-04 10:46:35 UTC (rev 101506)
@@ -68,11 +68,10 @@
"""
def numObjects():
- """Return the number of indexed objects"""
+ """Return the number of indexed objects."""
-# XXX: not implemented by TextIndex and TopicIndex
-# def indexSize():
-# """Return the size of the index in terms of distinct values"""
+ def indexSize():
+ """Return the size of the index in terms of distinct values."""
def clear():
"""Empty the index"""
More information about the Zope-Checkins
mailing list