Commit f396922c authored by Tim Peters's avatar Tim Peters

clear(): was ignoring the index_factory passed to the constructor,

reinitializing to the global Index even if that wasn't how the object
was constructed.
parent 91bf7475
...@@ -61,7 +61,8 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem): ...@@ -61,7 +61,8 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem):
% lexicon.getId() % lexicon.getId()
self.lexicon = lexicon self.lexicon = lexicon
self.index = index_factory(self.lexicon) self._index_factory = index_factory
self.clear()
## Pluggable Index APIs ## ## Pluggable Index APIs ##
...@@ -119,7 +120,7 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem): ...@@ -119,7 +120,7 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem):
def clear(self): def clear(self):
"""reinitialize the index""" """reinitialize the index"""
self.index = Index(self.lexicon) self.index = self._index_factory(self.lexicon)
def _get_object_text(self, obj): def _get_object_text(self, obj):
x = getattr(obj, self._fieldname) x = getattr(obj, self._fieldname)
......
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