Hi all,

I am having difficulty with search result in Drupal.

When searching pages, the result will include some CCK fields as well!
For instance I have a date field set using CCK and that is visible in the search result as well!

How can I prevent that?

Many thanks

Comments

freefontaine’s picture

I would really appreciate some help correcting this issue.

jastraat’s picture

I found an easy solution to this, however it may not work if you need to display those fields in your teasers.
Go to Administer > Content management > Content types
Click on the content type for which you want to edit the search result appearance. Click the 'Display fields' tab. Set the field in question to hidden for the teaser. If you aren't using the label in the actual content type or if you have a cck-node specific template in your theme, you can also hide the label.

------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)

freefontaine’s picture

I just figured that out...seemed a little to obvious to even try...but thanks for the reply.

WoozyDuck’s picture

Thank you very much for your reply
but this didn't work for me
I have also tried to reindex my search and run cron
didn't work, I can still see the CCK fields!
I am a doing something wrong?

beekerstudios’s picture

I was encountering the same issue, I was searching for something unrelated, and saw a cck field that should be hidden (for "behind the scenes" work), showing up in the search teaser. I was then able to search for cck fields, and the nodes and the teaser were being highlighted and shown. I hide those fields via this little tip, and it appears that the cck fields aren't being indexed, and they aren't showing up in teasers as well. I had performance caching, and the previous search I did on a word, was still coming up, the page was, but I cleared that page cache, and no results were returned.

All is good, this should be in the handbook, as a workaround to preventing and allowing indexing of cck fields. Great for user submitted content.