Is it possible to do a search on the content of one or several fields in a CCK content type, and if so how? And if not then can this be a feature request?

Comments

fago’s picture

Status: Active » Fixed

yeah it is, by using the views module and exposed filters.

martink’s picture

Status: Fixed » Active

But this sounds as if I have to set up, in effect, a different "search" function on my web site for each CCK content type. In other words, it dos not integrate with the standard site search.
In addition, I would have a question about performance. As I understand it, the different CCK "fields" are actually kept as serialised arrays in a single field in a CCK node - is this right? If that is the case, then is it possible to index the contents of a CCK field or are you forced to do a complete table scan and analyse every field as you go along? I imagine this would be a killer performance-wise.

fago’s picture

no, CCK creates appropriate tables for each content type. just have a look at your database.
and yes there is no integration into the site search

markdingemanse’s picture

So does this mean that the content I feed into custom content types will be invisible to the standard site search? In some setups that can be a serious problem.

hswong3i’s picture

they will appear within search result: as contain within body. this means that you can search them out, but can't filter them due to your custom field.

e.g. if you create a field call "company" within your custom content to hold the company information, the information will just seems to be within node body, but you won't have a select box/options/ajax autocomplete/etc for you to filter the search result due to this "company" field.

i face this problem, too. and so i implement another search function, as like as what node_search do, for my cck contents. please take node_search as example ;-)

moshe weitzman’s picture

Title: Does Search work on CCK fields? » Implement hook_search for custom fielded search

Add a tab or elements to search page so that we can search on 'company', as suggested earlier.

hswong3i’s picture

Status: Active » Closed (fixed)