fix description index for short comments.

svn path=/plone.app.discussion/trunk/; revision=27764
This commit is contained in:
Timo Stollenwerk
2009-07-01 10:01:37 +00:00
parent e2ab90641f
commit 9e94afc072
2 changed files with 18 additions and 6 deletions
+5 -2
View File
@@ -24,8 +24,11 @@ def creator(object):
@indexer(IComment)
def description(object):
# Return the first 25 words of the comment text and append '...'
return '%s...' % join(object.text.split()[:MAX_DESCRIPTION])
# Return the first 25 words of the comment text and append ' [...]'
text = join(object.text.split()[:MAX_DESCRIPTION])
if len(object.text.split()) > 25:
text += " [...]"
return text
@indexer(IComment)
def searchable_text(object):