On Monday 02 June 2008, Fred Jones wrote:
Try looking into views_fastsearch.module. It lets you leverage the search module's database for Views' exposed filters, creating a reasonably good facsimile of a per-field search.
I presume you mean to look into modifying the code, because AFAICT this module only provides a general search on all fields within the CCK nodes, but it can't be defined to search only only on one field.
On the other hand, in examining this, I have realized that I can create a view and expose a filter for each CCK field in question. This allows users to effectively search on those fields. The only issue now is to style the search fields and also, to set it up so that when the view first loads, no nodes appear (as opposed to ALL nodes appearing because no search terms were setup). For that I think I could hack the Views code.
Seems like this could be the easiest way actually. :)
Unless someone has a better idea.
Thanks, Fred
There's no need to hack Views for that. (Really, don't, you'll live longer.)
I believe you want to set the default value of the filter to empty, and then "use default" on the exposed filter. Or something along those lines. It may vary with the field type, but I know it is possible to setup an "empty by default" View because I've done it before myself.