Commit 9cbf0546 authored by 's avatar

- added 'indexSize' to IPluggableIndex

parent 6699c31f
...@@ -299,18 +299,6 @@ class DateRangeIndex(UnIndex): ...@@ -299,18 +299,6 @@ class DateRangeIndex(UnIndex):
return result, ( self._since_field, self._until_field ) 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. # Helper functions.
# #
......
...@@ -193,11 +193,11 @@ class PathIndex(Persistent, SimpleItem): ...@@ -193,11 +193,11 @@ class PathIndex(Persistent, SimpleItem):
return results return results
def numObjects(self): def numObjects(self):
""" return the number distinct values """ """Return the number of indexed objects."""
return len(self._unindex) return len(self._unindex)
def indexSize(self): def indexSize(self):
""" return the number of indexed objects""" """Return the size of the index in terms of distinct values."""
return len(self) return len(self)
def __len__(self): def __len__(self):
......
...@@ -85,6 +85,11 @@ class TopicIndex(Persistent, SimpleItem): ...@@ -85,6 +85,11 @@ class TopicIndex(Persistent, SimpleItem):
return 1 return 1
def numObjects(self): 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" return "n/a"
def search(self,filter_id): def search(self,filter_id):
......
...@@ -277,11 +277,11 @@ class UnIndex(SimpleItem): ...@@ -277,11 +277,11 @@ class UnIndex(SimpleItem):
return datum return datum
def numObjects(self): def numObjects(self):
""" return number of indexed objects """ """Return the number of indexed objects."""
return len(self._unindex) return len(self._unindex)
def indexSize(self): def indexSize(self):
""" return of distinct values indexed""" """Return the size of the index in terms of distinct values."""
return len(self) return len(self)
def unindex_object(self, documentId): def unindex_object(self, documentId):
......
...@@ -68,11 +68,10 @@ class IPluggableIndex(Interface): ...@@ -68,11 +68,10 @@ class IPluggableIndex(Interface):
""" """
def numObjects(): def numObjects():
"""Return the number of indexed objects""" """Return the number of indexed objects."""
# XXX: not implemented by TextIndex and TopicIndex def indexSize():
# def indexSize(): """Return the size of the index in terms of distinct values."""
# """Return the size of the index in terms of distinct values"""
def clear(): def clear():
"""Empty the index""" """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