Commit 9cbf0546 authored by 's avatar

- added 'indexSize' to IPluggableIndex

parent 6699c31f
......@@ -299,18 +299,6 @@ class DateRangeIndex(UnIndex):
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.
#
......
......@@ -193,11 +193,11 @@ class PathIndex(Persistent, SimpleItem):
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):
......
......@@ -85,6 +85,11 @@ class TopicIndex(Persistent, SimpleItem):
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):
......
......@@ -277,11 +277,11 @@ class UnIndex(SimpleItem):
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):
......
......@@ -68,11 +68,10 @@ class IPluggableIndex(Interface):
"""
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"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment