Drupal Search : Index All Fields of a CCK Node

The Drupal Search API is powerful and pretty intuitive, but finding details on how to do something as simple as enabling searching on fields other than title and body could be a little daunting.

It's actually quite a simple concept. Anything exposed to your node view will be indexed. You can easily accomplish this by editing your content type and setting the Display Fields setting to Plain Text.

But what if you have a node view which you don't want everything in $node->body? i.e. inside node-mynodetype.tpl.php, you separate out the author field from the body field.

So here's the scenario: You're creating a node template for a CCK type 'quote'. A quote contains text fields for title, author, and body. Well Drupal handles the title and body already so we just need to add a text field for author.

The problem now is that Author will show up twice. The easy way to fix this is to just use the content member of the $node variable. CCK will automatically add the fields and you can access them like this: