Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.6-1
Component:
General
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2008 at 19:14 UTC
Updated:
11 Mar 2010 at 12:00 UTC
Jump to comment: Most recent
Comments
Comment #1
meatbites commentedI found a way to get exactly what I'm after, but I was forced to modify node.module.
Basically, you need to disable indexing of the CCK field and stop the search result from showing the field as text padding. Unfortunately, hacking core seems to be the only option for this.
Modified node_search function (near the end of case 'search'):
Modified node_update_index function:
So, I guess this is a feature request.
Comment #2
kardave commentedHey, this feature's opposit is what i need :)
I would like hidden CCK field to show up in search results.
I use CCK fields for subtitles, and IDs for big amount imported stories.
These fields are set to hidden, but shown by my custom theme, except the imported stories' previous IDs.
I made this old id field just to let visitors find the old articles. (search404 module).
Until I can't set CCK fields to have indexed or not, I must do the known CSS hide trick.
(set the fiels to visible, but hide by css)
Thanks your work so much!
K. David
Comment #3
TimeBandit commentedYou could consider using the Views Fast Search module to help modify search: http://drupal.org/project/views_fastsearch
Then use phptemplate_views_fastsearch_display function in template.php and you won't have to modify node.module.
example (after installing and setting up fast search):
I also changed the results to an ordered list so you may want to use the original function from views_fastsearch.module...
Comment #4
deltab commented+1
Comment #5
nally commentedHas anyone made any progress with this issue?
Presumably, having the search system ignore certain fields could make for a lighter, faster search.
Also, can anyone with specific search expertise mention anything on the possibility of having a search index for each role?
Also, in particular, are we still only talking about D5?
Comment #6
TimeBandit commentedI did the following in a more recent project. I don't use fastsearch any longer, and this is for Drupal 6. It basically disregards the actual search result ($snippet variable) and looks at the item's body['#value']. Then I strip out carriage returns, spaces, yadda. Your mileage may vary... you may need to strip other stuff out of the result.
Put this in search-result.tpl.php in your theme. Of course, I have extraneous code and commented-out code so clean it up as you need to:
Comment #7
nally commentedThanks TimeBandit.
I'm interested in the possibility of preventing (specific, certain) CCK fields from being indexed at all.
Is it true that your solution filters search hits out at theme time? I'm looking for something that would keep that node out of the search result set in the first place by preventing that field from being in the search index at all.
(I'm also trying to get that to work with Solr integration.)
Comment #8
gerhard killesreiter commentedCCK has a setting for this:
Go to your content type, then "display fields", then "search", and then you can chose whether fields should be excluded during indexing and/or display.
Comment #10
ceci123 commentedI tried this solution and it doesn't work. See My configuration.
Am I don't it right?