The core Drupal search module indexes comments along with the node title and body. It also allows other modules to alter the node before it indexes it.

This patch updates node_xapian_index() to first allow other modules to change the node before it is indexed. It also invokes the nodeapi's 'update index' operator, allowing other modules to attach node content to the search indexes. In particular, this causes comments to get indexed along with the node contents.

It also makes xapian_reindex_queued_nodes a little more consistent with the core search code using an object instead of an array when indexing nodes.

It also implements the _comment hook, so nodes are reindexed as comments are added/updated/deleted/published/unpublished.

CommentFileSizeAuthor
#2 xapian.module.patch2.95 KBjeremy
xapian.module.patch2.54 KBjeremy

Comments

jeremy’s picture

Status: Needs review » Needs work

Doing test searches, I'm seeing some blank results come back ever since this patch. I need to review closer what has broken -- updating the issue status to note that this patch does not appear to be ready for prime time yet.

jeremy’s picture

Status: Needs work » Needs review
StatusFileSize
new2.95 KB

The blank results I was getting was because I wiped my Drupal database, but neglected to wipe my Xapian database too. Once I did that, everything was working perfectly again - so it was my fault, not a bug in the code.

Here's an updated version of the patch. In addition to the above, it also prevents the same node from being added to the index queue twice -- that's just wasted effort.

singularo’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.