Search on additional fields added to new CCK type contents

zigma - March 20, 2007 - 03:04
Project:SQL Search (Trip Search)
Version:5.x-1.6
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I am trying to set this up for a custom content type.
I have added two new fields to my custom content type.

Is it possible either with the current set of tools or with some enhancement to include those fields as well in the search on my custom CCK type?

#1

joel_guesclin - March 20, 2007 - 09:40

At the moment trip_search uses the title and body fields of a node (it also searches on comments if these are enabled). CCK fields are kept in completely different tables, using specific column names. Consequently, making it possible to search on a CCK field other than title (and whatever ends up in body - it could often be empty) would require a considerable amount of work: in my view the following would be necessary:

  • as well as a generic search as at present, it would be necessary to allow trip_search to be called with a particular interface for each CCK type, such that the user could specify that he wanted to search for particular content in a particular field;
  • this interface would need to be built by trip_search analysing the various CCK types available in order to determine what fields could be searched on
  • the generated SQL would also need to be specific for each CCK type

All this would be a substantial amount of work.
A much easier enhancement would be to include the teaser in the indexed fields that trip_search uses - since CCK allows you to specify what goes in the teaser, it would be a means of including CCK fields, as long as these appeared in the teaser.
I would be interested to know what "mindless" thinks of this.

 
 

Drupal is a registered trademark of Dries Buytaert.