I have created a Field collection in one of my content types. The body and title fields of the content type are indexed just fine, but the content of the Field collection field is not. So if I run cron to index all nodes, and then search for a word in a field in the Field collection, the node doesn't show up in the search result. If I look in table search_dataset, the words from the Field collection field are also not present.

Is there any way to include Field collection fields in the search index?

Comments

phenaproxima’s picture

I'd like this functionality as well. Is it just a matter of implementing the regular search hooks?

aendra’s picture

I concur! Would love to use core search -- having to run a Solr server is so bad for memory...

ilpado’s picture

not even in beta 5 contents are searchable, you have solved in any way?

topdillon’s picture

For what it's worth, there is an alpha mod if you are using SOLR.

peter_fanter’s picture

Issue summary: View changes

is there something similar for search api solr?

stevenlafl’s picture

Did anyone get anywhere with this? I want to be able to search and sort by these fields. Edit: you may be able to create a module that makes use of hook_node_update_index

vensires’s picture

I don't know if this is still an issue in 7.x-1.0-beta10 but in case it helps anyone, a working scenario with core search module was the following:

  1. I have made sure the content type's "Search index" view mode displays "Fields only" for the field collection field.
  2. I have enabled the "Transliterate search index and searched strings" option provided by transliteration module.
  3. I have enabled the "Simple CJK handling" option.

For some reason, if the 3rd option (CJK handling) wasn't enabled, search didn't work for field collection items. Don't forget to clear caches and reindex.

PS: According to the Search interface documentation on drupal.org: "the search system already indexes all visible output of a node; i.e., everything displayed normally by hook_view() and hook_node_view(). This is usually sufficient". As a result, you'd better make also sure the node's search_index view mode properly displays all the field collection items.