Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
actually preserve the index_document optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Dec 3, 2012
1 parent 0a25fc9 commit ace69a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Products/ZCTextIndex/ZCTextIndex.py
Expand Up @@ -182,17 +182,15 @@ def index_object(self, documentId, obj, threshold=None):
continue
if safe_callable(text):
text = text()
if text is None:
continue
if text:
if text is not None:
if isinstance(text, (list, tuple, )):
all_texts.extend(text)
else:
all_texts.append(text)

# Check that we're sending only strings
all_texts = [t for t in all_texts if isinstance(t, basestring)]
if all_texts or self.index.length():
if all_texts:
return self.index.index_doc(documentId, all_texts)
return 0

Expand Down

0 comments on commit ace69a9

Please sign in to comment.