[Zope-CVS] CVS: Products/ZCTextIndex - BaseIndex.py:1.9

Tim Peters tim.one@comcast.net
Fri, 17 May 2002 04:02:02 -0400


Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv5731

Modified Files:
	BaseIndex.py 
Log Message:
Implement correct (albeit inefficient) reindexing, and stop cheating
in the reindexing text.


=== Products/ZCTextIndex/BaseIndex.py 1.8 => 1.9 ===
     # A subclass may wish to extend or override this.
     def index_doc(self, docid, text):
-        # XXX If docid is already known, do something smart.
+        if self._docwords.has_key(docid):
+            # XXX Do something smarter than this.
+            self.unindex_doc(docid)
         wids = self._lexicon.sourceToWordIds(text)
         wid2weight, docweight = self._get_frequencies(wids)
         for wid, weight in wid2weight.items():