[Zope3-checkins] SVN: Zope3/trunk/src/zope/index/text/okapiindex.py Changed unindex_doc to ignore docids not in the index

Jim Fulton jim at zope.com
Sun Aug 29 16:54:05 EDT 2004


Log message for revision 27336:
  Changed unindex_doc to ignore docids not in the index
  


Changed:
  U   Zope3/trunk/src/zope/index/text/okapiindex.py


-=-
Modified: Zope3/trunk/src/zope/index/text/okapiindex.py
===================================================================
--- Zope3/trunk/src/zope/index/text/okapiindex.py	2004-08-29 20:53:11 UTC (rev 27335)
+++ Zope3/trunk/src/zope/index/text/okapiindex.py	2004-08-29 20:54:05 UTC (rev 27336)
@@ -231,7 +231,7 @@
         return BaseIndex._reindex_doc(self, docid, text)
 
     def unindex_doc(self, docid):
-        self._totaldoclen -= self._docweight[docid]
+        self._totaldoclen -= self._docweight.get(docid, 0)
         BaseIndex.unindex_doc(self, docid)
 
     # The workhorse.  Return a list of (IIBucket, weight) pairs, one pair



More information about the Zope3-Checkins mailing list