[Zope-CVS] CVS: Products/ZCTextIndex - ZCTextIndex.py:1.18
Guido van Rossum
guido@python.org
Tue, 21 May 2002 11:17:41 -0400
Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv18257
Modified Files:
ZCTextIndex.py
Log Message:
I figured out what numObjects() is for -- it is used by ZCatalog's
Index management screen. Ditto for clear(). So group them together
and adjust the comment. (So is manage_main, but since it's a DTML
method, it can stay in its separate UI group.)
=== Products/ZCTextIndex/ZCTextIndex.py 1.17 => 1.18 ===
return chooser.getbest(), len(results)
- def numObjects(self):
- """Return number of object indexed"""
- return self.index.length()
-
## Pluggable Index APIs ##
def index_object(self, docid, obj, threshold=None):
@@ -133,10 +129,14 @@
get_word = self.lexicon.get_word
return [get_word(wid) for wid in word_ids]
- ## XXX To which API does this conform? ##
+ ## The ZCatalog Index management screen uses these methods ##
+
+ def numObjects(self):
+ """Return number of unique words in the index"""
+ return self.index.length()
def clear(self):
- """reinitialize the index"""
+ """reinitialize the index (but not the lexicon)"""
self.index = self._index_factory(self.lexicon)
## User Interface Methods ##