If using Filefield on node comments, they are not indexed.
Even with entityreference submodule, the files stay away from search index.

Comments

pebosi created an issue. See original summary.

izus’s picture

Thanks pebosi for spotting this need, i confirm nothing was done for supporting comments.

can you follow the example of search_api_attachments submodules to provide a patch that adds a submodule to support attachemnts in comments ?
i think example of entityreference submodule is the closest to your need here.
Thanks

grimreaper’s picture

Status: Active » Needs review
StatusFileSize
new7.46 KB

Hello,

Here is a patch that allow to index file fields on node comments.

I encountered a fatal error when trying to create a search api index on comment directly. I suppose it is a bug in search api and I also supposed that the common use case of this feature is to add the comment attachment on node indexes.

To mark the node to be reindexed, I use the hooks comment_insert/update/delete without restriction. Maybe it will be a performance issue. We can discuss of a solution to be more precise if you want.

Note: I begin to be fed up to have multiple of sub-modules to maintain (help maintaining :)) and that each sub-modules have 90% of code in common.

Thanks for the review.

izus’s picture

hi pebosi,
were you able to test this patch? is it working for you ?

  • izus committed e78c5f0 on 7.x-1.x authored by Grimreaper
    Issue #2570233 by Grimreaper, izus: Files attached to comments, get not...
izus’s picture

Status: Needs review » Fixed

hi,
merged #3 to not loose Grimreaper's effort on this.
Thanks

Status: Fixed » Closed (fixed)

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