Merge pull request #152 from derFreitag/index-comments-on-solr
Index comments on Solr
This commit is contained in:
commit
bc42fb2d9a
3
news/77.feature
Normal file
3
news/77.feature
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Index/reindex/unindex the comment itself, do not defer to ``ICommentingTool``.
|
||||||
|
This way it can be integrated into collective.indexing and Solr (or any other indexing tool).
|
||||||
|
[gforcada]
|
@ -5,12 +5,10 @@ from Products.CMFCore.utils import getToolByName
|
|||||||
def index_object(obj, event):
|
def index_object(obj, event):
|
||||||
"""Index the object when it is added/modified to the conversation.
|
"""Index the object when it is added/modified to the conversation.
|
||||||
"""
|
"""
|
||||||
catalog = getToolByName(obj, 'portal_catalog')
|
obj.indexObject()
|
||||||
return catalog.reindexObject(obj)
|
|
||||||
|
|
||||||
|
|
||||||
def unindex_object(obj, event):
|
def unindex_object(obj, event):
|
||||||
"""Unindex the object when it is removed from the conversation.
|
"""Unindex the object when it is removed from the conversation.
|
||||||
"""
|
"""
|
||||||
catalog = getToolByName(obj, 'portal_catalog')
|
obj.unindexObject()
|
||||||
return catalog.unindexObject(obj)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user