Commit 15df1cd2 authored by Christopher Petrilli's avatar Christopher Petrilli

Merged in changes from branch to make sure that things get unindexed before

they get reindexed.
parent 368e5e1c
...@@ -84,7 +84,9 @@ ...@@ -84,7 +84,9 @@
############################################################################## ##############################################################################
"""Simple column indices""" """Simple column indices"""
__version__='$Revision: 1.14 $'[11:-2]
__version__='$Revision: 1.15 $'[11:-2]
from Globals import Persistent from Globals import Persistent
from Acquisition import Implicit from Acquisition import Implicit
...@@ -157,6 +159,10 @@ class UnIndex(Persistent, Implicit): ...@@ -157,6 +159,10 @@ class UnIndex(Persistent, Implicit):
def index_object(self, i, obj, threshold=None): def index_object(self, i, obj, threshold=None):
""" index and object 'obj' with integer id 'i'""" """ index and object 'obj' with integer id 'i'"""
# Before we do anything, unindex the object we've been handed, as
# we can't depend on the user to do the right thing.
self.unindex_object(i)
index = self._index index = self._index
unindex = self._unindex unindex = self._unindex
......
...@@ -16,6 +16,10 @@ class UnKeywordIndex(UnIndex): ...@@ -16,6 +16,10 @@ class UnKeywordIndex(UnIndex):
def index_object(self, i, obj, threshold=None): def index_object(self, i, obj, threshold=None):
""" index an object 'obj' with integer id 'i'""" """ index an object 'obj' with integer id 'i'"""
# Before we do anything, unindex the object we've been handed, as
# we can't depend on the user to do the right thing.
self.unindex_object(i)
index = self._index index = self._index
unindex = self._unindex unindex = self._unindex
...@@ -51,8 +55,7 @@ class UnKeywordIndex(UnIndex): ...@@ -51,8 +55,7 @@ class UnKeywordIndex(UnIndex):
kws = unindex.get(i, None) kws = unindex.get(i, None)
if kws is None: if kws is None:
LOG('UnKeywordIndex', ERROR,('unindex_object was called with bad ' return None
'integer id %s' % str(i)))
for kw in kws: for kw in kws:
set = index.get(kw, None) set = index.get(kw, None)
if set is not None: if set is not None:
......
...@@ -92,7 +92,8 @@ is no longer known. ...@@ -92,7 +92,8 @@ is no longer known.
""" """
__version__='$Revision: 1.28 $'[11:-2] __version__='$Revision: 1.29 $'[11:-2]
from Globals import Persistent from Globals import Persistent
import BTree, IIBTree, IOBTree, OIBTree import BTree, IIBTree, IOBTree, OIBTree
...@@ -226,7 +227,10 @@ class UnTextIndex(Persistent, Implicit): ...@@ -226,7 +227,10 @@ class UnTextIndex(Persistent, Implicit):
the next four arguments are default optimizations. the next four arguments are default optimizations.
""" """
# Before we do anything, unindex the object we've been handed, as
# we can't depend on the user to do the right thing.
self.unindex_object(i)
id = self.id id = self.id
try: try:
## sniff the object for our 'id', the 'document source' of ## sniff the object for our 'id', the 'document source' of
......
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