Closed (won't fix)
Project:
Community Tags
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Jan 2008 at 23:39 UTC
Updated:
18 Mar 2011 at 16:27 UTC
When users add tags to content, the search index is not updated (after running cron.php). To get the index to include the new tags, the node author actually needs to resubmit the node edit form (which sort of dilutes the value of community_tags).
I was hoping to create a patch and contribute it back, however I'm having a hard time groking what I can call from within the module to force the node to be reindexed. Can someone provide some guidance?
Comments
Comment #1
ryan_courtnage commentedI've fixed this problem by implementing hook_update_index(). The following function can by put anywere in community_tags.module. It basically determines what tags are new by comparing the last index date (node_cron_last), and then goes ahead and reindexes the affected nodes.
Hope this helps someone else and that we can get this committed.
Comment #2
owahab commentedI think this patch is good to go.
If none had a point against it in the next week, it'll go.
Comment #3
owahab commentedComment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
jaydub commentedThis line:
$sql = "SELECT nid FROM community_tags WHERE date > %d";
needs to be changed to allow for different table name prefixes:
$sql = "SELECT nid FROM {community_tags} WHERE date > %d";
Comment #6
owahab commentedThanks jaydub.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #8
dropcube commentedI understand the need of re-indexing the node content after a user tagging, however, implementing
hook_update_index()does not seem to be a good idea. The current implementation ofcommunity_tags_update_index()is nearly the same asnode_update_index(). Updating the search index is a responsibility of the node and search modules. All we need to do is to notify that a node has been updated, or in the worst case update the search index of a single node after tagging it.- The search module of 6.x has a function search_touch_node(), which can be called after saving new community tags, so this may be the solution for 6.x
- For 5.x, calling
_node_index_node($node)may be an approach, but we need to evaluate performance implications that it may has.Thoughts?
Comment #9
dropcube commentedIn fact, for 5.x an approach similar to search_touch_node() may work.
Comment #10
dropcube commentedI have removed the hook_update_index() from the 6.x branch and it's using search_touch_node() as described in #8.
Nodes are marked for re-indexing after adding/removing tags and the tags are included/removed from the search index when the cron runs. So, it's working as expected.
I have to work out in a similar approach for 5.x.
Comment #11
chaps2 commentedClosed per #1068648: Community Tags 5.x no longer supported.