I am using the DB to store the search criteria and the result. Not
that the result creates more information, it creates only
relationships between the stored search criteria and the existing
records in other tables.

The search is currently only based on one subject, either Article,
Blog, Ebook, or Author, but can easily be expanded to search through
all of the subjects.

The Enquiry model stores the search criteria, thus getting an ID. The
model has a HABTM relationship with the above subject models. The
Enquiry model passes on the search criteria with the ID to the
relevant subject model, which then executes the search within its
records. The subject model passes on the resulting subject ids to the
HABTM model, which stores the result.

The Enquiry model ID is then passed back to the controller, which uses
paginate to show the result.

A short version of the ER diagram can be seen here:
http://jaa.myftp.org:28880/examples/enquiry

The way I have implemented this, also allows me to keep a history of
search within the session. The history is also presented to the user,
thus allowing the user to go back to previous results.

Hope the above explanation is usefull to you :)
Enjoy,
   John


On Jun 10, 10:04 am, Ed Propsner <crotchf...@gmail.com> wrote:
[snip part for Calvin]
> @John:
>
> Are you using the db to cache your search results on the server side? I
> learned some hard lessons in the past and need to cut down the load wherever
> I can. Is there any specific advantages to setting up your search the way
> you have it?
>
> - Ed

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to