[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - TextIndex.py:1.17

Andreas Jung andreas@zope.com
Wed, 3 Oct 2001 14:00:09 -0400


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv3839

Modified Files:
	TextIndex.py 
Log Message:
clearing the vocabulary made it impossible to create a new ZCatalog
*sigh*


=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.16 => 1.17 ===
         self.useOperator  = 'or'
 
-        self.clear()
 
         if extra:   self.vocabulary_id = extra.vocabulary
         else:       self.vocabulary_id = "Vocabulary"
 
         self._lexicon = None
+        self.clear()
 
         if lexicon is not None:
 
@@ -228,7 +228,8 @@
         """Reinitialize the text index."""
         self._index   = IOBTree()
         self._unindex = IOBTree()
-        self.getLexicon().clear()
+        if self.getLexicon():
+            self.getLexicon().clear()
         self._lexicon = None
 
     def _convertBTrees(self, threshold=200):